|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--net.sf.saxon.type.SchemaType
This class represents a simple type or complex type as defined in XML Schema. In the non-schema-aware version of Saxon it is used to represent built-in schema types only. In the schema-aware version it is subclassed to represent user-defined types.
Field Summary | |
static int |
ALL_DERIVATIONS
|
static int |
DERIVE_BY_EXTENSION
|
static int |
DERIVE_BY_LIST
|
static int |
DERIVE_BY_RESTRICTION
|
static int |
DERIVE_BY_SUBSTITUTION
|
static int |
DERIVE_BY_UNION
|
protected int |
finalProhibitions
Flags used to implement the "final" and "block" attributes |
static int |
INVALID
|
static int |
UNVALIDATED
|
static int |
VALIDATED
|
static int |
VALIDATING
|
protected int |
validationPhase
Flag used to check for cycles during validation |
Constructor Summary | |
SchemaType()
Default constructor. |
Method Summary | |
boolean |
allowsDerivation(int derivation)
Determines whether derivation (of a particular kind) from this type is allowed, based on the "final" property |
void |
checkDerivation(SchemaType type,
int block)
Check that this type is validly derived from a given type |
boolean |
containingDeclarationIsElement()
Determine whether the containing declaration is an element declaration or an attribute declaration |
SchemaType |
getBaseType()
Returns the base type that this type inherits from. |
int |
getBaseTypeFingerprint()
Get the fingerprint of the name of the base type of this type |
int |
getBlock()
Returns the value of the 'block' attribute for this type, as a bit-signnificant integer with fields such as DERIVE_BY_LIST and DERIVE_BY_EXTENSION |
int |
getColumnNumber()
Get the column number of the location where the type was defined. |
int |
getContainingDeclarationName()
Get the name of the containing element or attribute declaration, if any (and if known) |
int |
getDerivationMethod()
Gets the integer code of the derivation method used to derive this type from its parent. |
java.lang.String |
getDescription()
Get a description of this type for use in diagnostics. |
java.lang.String |
getDisplayName()
Get the display name of the type: that is, a lexical QName with an arbitrary prefix |
int |
getFingerprint()
Get the fingerprint of the name of this type |
int |
getLineNumber()
Get the line number of the location where the type was defined |
java.lang.String |
getLocalName()
Get the local name of this type |
NamePool |
getNamePool()
Get the NamePool in which the name of this type is defined |
java.lang.String |
getPublicId()
Get the public ID of the location where the type was defined. |
java.lang.String |
getSystemId()
Get the system ID (URI) of the schema document where the type was defined |
abstract SequenceIterator |
getTypedValue(NodeInfo node)
Get the typed value of a node that is annotated with this schema type |
boolean |
isComplexType()
Test whether this SchemaType is a complex type |
abstract boolean |
isSimpleType()
Test whether this SchemaType is a simple type |
void |
setBaseType(SchemaType baseType)
Sets the base type for this datatype. |
void |
setBaseTypeFingerprint(int fingerprint)
Set the fingerprint of the name of the base type of this type. |
void |
setContainingDeclaration(int fingerprint,
boolean isElement)
Set the name of the containing declaration (for diagnostics) |
void |
setDerivationMethod(int method)
Sets the derivation method code (without validating it) |
void |
setDerivationMethodName(java.lang.String method)
Set the derivation method name. |
void |
setFinalProhibitions(int finalValue)
Sets the value of the 'final' property, indicating which types of derivation are not allowed. |
void |
setFingerprint(int fingerprint)
Set the fingerprint of the name of this type. |
void |
setLineNumber(int lineNumber)
Set the line number at which the type is defined within a schema document |
void |
setLocalName(java.lang.String localName)
Set the local name of this type |
void |
setLocator(javax.xml.transform.SourceLocator locator)
Set location information for diagnostics |
void |
setNamePool(NamePool pool)
Set the NamePool in which the type is defined. |
void |
setSystemId(java.lang.String systemId)
Set the system identifier (URI) of the schema document in which this type is defined |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
protected int finalProhibitions
public static final int DERIVE_BY_RESTRICTION
public static final int DERIVE_BY_EXTENSION
public static final int DERIVE_BY_UNION
public static final int DERIVE_BY_LIST
public static final int DERIVE_BY_SUBSTITUTION
public static final int ALL_DERIVATIONS
protected int validationPhase
public static final int UNVALIDATED
public static final int VALIDATING
public static final int VALIDATED
public static final int INVALID
Constructor Detail |
public SchemaType()
Method Detail |
public int getFingerprint()
public void setFingerprint(int fingerprint)
fingerprint
- the fingerprint allocated in the namepool for this schemapublic int getBaseTypeFingerprint()
public void setBaseTypeFingerprint(int fingerprint)
fingerprint
- the fingerprint allocated in the namepoolpublic java.lang.String getLocalName()
public void setLocalName(java.lang.String localName)
localName
- the local name of the typepublic java.lang.String getDisplayName()
public final boolean isComplexType()
public abstract boolean isSimpleType()
public int getBlock()
DERIVE_BY_LIST
and DERIVE_BY_EXTENSION
public NamePool getNamePool()
public void setNamePool(NamePool pool)
pool
- the NamePool containing the names in this schemapublic SchemaType getBaseType()
public void setBaseType(SchemaType baseType) throws SchemaException
baseType
- the base type which this type inherits from
SchemaException
public int getDerivationMethod()
DERIVE_BY_RESTRICTION
public boolean allowsDerivation(int derivation)
derivation
- the kind of derivation, for example DERIVE_BY_LIST
public void setDerivationMethodName(java.lang.String method) throws SchemaException
method
- the derivation method, for example "restriction"
SchemaException
- for an unknown derivation methodpublic void setDerivationMethod(int method)
method
- the derivation method as an integer code, for example DERIVE_BY_UNION
public void setFinalProhibitions(int finalValue)
finalValue
- the value of the final property, as a bit-significant integerpublic void checkDerivation(SchemaType type, int block) throws SchemaException
type
- the type from which this type is derivedblock
- the derivations that are blocked by the relevant element declaration
SchemaException
- if the derivation is not allowedpublic abstract SequenceIterator getTypedValue(NodeInfo node) throws XPathException
node
- the node whose typed value is required
AtomicValue
XPathException
public void setContainingDeclaration(int fingerprint, boolean isElement)
fingerprint
- The fingerprint of the element or attribute declaration "owning" this anonymous
type definitionisElement
- True if the owning declaration is an element declaration, false if it is an
attribute declarationpublic void setLocator(javax.xml.transform.SourceLocator locator)
locator
- information about the location of the type definition within a schema documentpublic void setSystemId(java.lang.String systemId)
systemId
- the URI of the schema documentpublic void setLineNumber(int lineNumber)
lineNumber
- the line where the definition appearspublic java.lang.String getSystemId()
getSystemId
in interface javax.xml.transform.SourceLocator
public int getLineNumber()
getLineNumber
in interface javax.xml.transform.SourceLocator
public java.lang.String getPublicId()
getPublicId
in interface javax.xml.transform.SourceLocator
public int getColumnNumber()
getColumnNumber
in interface javax.xml.transform.SourceLocator
public java.lang.String getDescription()
public int getContainingDeclarationName()
public boolean containingDeclarationIsElement()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |