|
|||||||||
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.UserDefinedType
public abstract class UserDefinedType
This class represents a user-defined simple type or complex type as defined in XML Schema.
Field Summary | |
---|---|
protected Set |
extendedTypes
The set of all the types that are derived by extension from this type |
protected int |
finalProhibitions
Flags used to implement the "final" and "block" attributes |
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 | |
---|---|
UserDefinedType()
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 |
hasRegisteredExtension(UserComplexType extension)
Determine whether a particular complex type is among the registered extensions of this type |
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. |
Iterator |
iterateExtensionTypes()
Iterate over all the types defined as extensions of this type, transitively |
protected void |
registerExtensionType(UserComplexType derived)
Register another type as an extension of this 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 |
setExtendedTypes(Set types)
Set the set of types derived by extension from this one |
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, getRedefinitionLevel, getSchemaDocumentURI, getSystemId, getValidationStatus, lookForCycles, setConfiguration, setFixupStatus, setLineNumber, setLocator, setRedefinitionLevel, setSchemaDocumentURI, setSystemId, setValidationStatus |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface com.saxonica.schema.UserSchemaComponent |
---|
elaborate, fixup, lookForCycles, validate |
Methods inherited from interface net.sf.saxon.type.SchemaType |
---|
analyzeContentExpression, atomize, getSystemId, getTypedValue, isAtomicType, isIdRefType, isIdType, isSimpleType |
Methods inherited from interface net.sf.saxon.type.SchemaComponent |
---|
getRedefinitionLevel, getValidationStatus |
Field Detail |
---|
protected int finalProhibitions
protected Set extendedTypes
Constructor Detail |
---|
public UserDefinedType()
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
protected void registerExtensionType(UserComplexType derived)
derived
- the type that is derived from this one by extensionpublic Iterator iterateExtensionTypes()
public boolean hasRegisteredExtension(UserComplexType extension)
extension
- the type to be tested to see whether it is an extension of this one
public void setExtendedTypes(Set types)
types
- the set of extended types
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |