|
|||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.saxonica.schema.SchemaStructure com.saxonica.schema.SchemaTypeImpl
public abstract class SchemaTypeImpl
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 |
---|
Fields inherited from interface net.sf.saxon.type.SchemaType |
---|
DERIVATION_EXTENSION, DERIVATION_LIST, DERIVATION_RESTRICTION, DERIVATION_UNION, DERIVE_BY_SUBSTITUTION |
Fields inherited from interface net.sf.saxon.type.SchemaComponent |
---|
FIXED_UP, INCOMPLETE, INVALID, UNVALIDATED, VALIDATED, VALIDATING |
Constructor Summary | |
---|---|
SchemaTypeImpl()
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 |
checkTypeDerivationIsOK(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 |
TypeReference |
getBaseTypeReference()
Get the reference to the base type. |
int |
getBlock()
Returns the value of the 'block' attribute for this type, as a bit-signnificant integer with fields such as SchemaType.DERIVATION_LIST and SchemaType.DERIVATION_EXTENSION |
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. |
String |
getDescription()
Get a description of this type for use in diagnostics. |
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 |
String |
getLocalName()
Deprecated. since 9.0: use the equivalent method getName() |
String |
getName()
Get the local name of this type if it has one |
int |
getNameCode()
Get the namecode of the name of this type. |
NamePool |
getNamePool()
Get the NamePool in which the name of this type is defined |
String |
getTargetNamespace()
Get the namespace URI of the name of this type if it has one |
boolean |
isAnonymousType()
Test whether this is an anonymous type |
boolean |
isComplexType()
Test whether this SchemaType is a complex type |
boolean |
isExternalType()
Return true if this is an external object type, that is, a Saxon-defined type for external Java or .NET objects |
boolean |
isSameType(SchemaType other)
Test whether this is the same type as another type. |
void |
setBaseTypeReference(TypeReference baseType)
Sets the base type for this datatype. |
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(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 |
setNameCode(int nameCode)
Set the nameCode of the name of this type. |
Methods inherited from class com.saxonica.schema.SchemaStructure |
---|
elaborate, fixup, getColumnNumber, getConfiguration, getFixupStatus, getLineNumber, getPublicId, getSystemId, getValidationStatus, lookForCycles, setConfiguration, setFixupStatus, setLineNumber, setLocator, setSystemId, setValidationStatus |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface net.sf.saxon.type.SchemaType |
---|
analyzeContentExpression, atomize, getSystemId, getTypedValue, isAtomicType, isSimpleType |
Methods inherited from interface net.sf.saxon.type.SchemaComponent |
---|
getValidationStatus |
Constructor Detail |
---|
public SchemaTypeImpl()
Method Detail |
---|
public String getName()
getName
in interface SchemaType
public String getTargetNamespace()
getTargetNamespace
in interface SchemaType
public boolean isExternalType()
public int getFingerprint()
getFingerprint
in interface SchemaType
public int getNameCode()
getNameCode
in interface SchemaType
public boolean isAnonymousType()
isAnonymousType
in interface SchemaType
public void setNameCode(int nameCode)
nameCode
- the nameCode allocated in the namepool for this schemapublic TypeReference getBaseTypeReference()
public int getBaseTypeFingerprint()
public String getLocalName()
getName()
public String getDisplayName()
getDisplayName
in interface SchemaType
public final boolean isComplexType()
isComplexType
in interface SchemaType
public int getBlock()
SchemaType.DERIVATION_LIST
and SchemaType.DERIVATION_EXTENSION
getBlock
in interface SchemaType
public NamePool getNamePool()
public SchemaType getBaseType() throws UnresolvedReferenceException
getBaseType
in interface SchemaType
UnresolvedReferenceException
- if this type has no known base type. This can only arise during
schema construction, since a type with an unknown base type cannot be used for validationpublic void setBaseTypeReference(TypeReference baseType)
baseType
- the base type which this type inherits frompublic int getDerivationMethod()
getDerivationMethod
in interface SchemaType
SchemaType.DERIVATION_RESTRICTION
public boolean allowsDerivation(int derivation)
allowsDerivation
in interface SchemaType
derivation
- the kind of derivation, for example SchemaType.DERIVATION_LIST
public void setDerivationMethodName(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 SchemaType.DERIVATION_UNION
public void setFinalProhibitions(int finalValue)
finalValue
- the value of the final property, as a bit-significant integerpublic void checkTypeDerivationIsOK(SchemaType type, int block) throws SchemaException
checkTypeDerivationIsOK
in interface SchemaType
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 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 String getDescription()
getDescription
in interface SchemaType
public int getContainingDeclarationName()
public boolean containingDeclarationIsElement()
public boolean isSameType(SchemaType other)
isSameType
in interface SchemaType
other
- the other type
|
|||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |