public abstract class UserDefinedType extends SchemaStructure implements UserSchemaComponent, SchemaType
Modifier and Type | Field and Description |
---|---|
protected Set<UserComplexType> |
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
|
DERIVATION_EXTENSION, DERIVATION_LIST, DERIVATION_RESTRICTION, DERIVATION_UNION, DERIVE_BY_SUBSTITUTION
COMPONENT_FUNCTION_TYPE, FIXED_UP, INCOMPLETE, INVALID, UNVALIDATED, VALIDATED, VALIDATING
Constructor and Description |
---|
UserDefinedType()
Default constructor.
|
Modifier and Type | Method and Description |
---|---|
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 |
StructuredQName |
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
|
String |
getEQName()
Get the name of this type as an EQName, that is, a string in the format Q{uri}local.
|
Set<UserComplexType> |
getExtensionTypes()
Get all the types defined as extensions of this type, transitively
|
int |
getFinalProhibitions()
Get the types of derivation that are not permitted, by virtue of the "final" property.
|
int |
getFingerprint()
Get the fingerprint of the name of this type
|
String |
getName()
Get the local name of this type if it has one.
|
NamePool |
getNamePool()
Get the NamePool in which the name of this type is defined
|
StructuredQName |
getStructuredQName()
Get the name of the type as a StructuredQName
|
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.
|
static boolean |
isSameURI(String s1,
String s2)
Compare two URIs, ignoring the "file:///" versus "file:/" difference
|
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(StructuredQName declarationName,
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<UserComplexType> 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 |
setTypeName(StructuredQName name,
int nameCode)
Set the nameCode of the name of this type.
|
String |
toString() |
elaborate, fixup, getColumnNumber, getConfiguration, getFixupStatus, getLineNumber, getPublicId, getRedefinitionLevel, getSchemaDocumentURI, getSystemId, getValidationStatus, lookForCycles, makeXPathExpressionPropertyRecord, saveLocation, setConfiguration, setFixupStatus, setLineNumber, setLocator, setRedefinitionLevel, setSchemaDocumentURI, setSystemId, setValidationStatus
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
elaborate, fixup, lookForCycles, validate
analyzeContentExpression, atomize, getSystemId, isAtomicType, isIdRefType, isIdType, isSimpleType
getComponentAsFunction, getRedefinitionLevel, getValidationStatus
protected int finalProhibitions
protected Set<UserComplexType> extendedTypes
public UserDefinedType()
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 StructuredQName getStructuredQName()
getStructuredQName
in interface SchemaType
public String getEQName()
getEQName
in interface SchemaType
public boolean isAnonymousType()
isAnonymousType
in interface SchemaType
public void setTypeName(StructuredQName name, int nameCode)
nameCode
- the nameCode allocated in the namepool for this schemapublic TypeReference getBaseTypeReference()
public int getBaseTypeFingerprint()
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()
getBaseType
in interface SchemaType
IllegalStateException
- 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 int getFinalProhibitions()
getFinalProhibitions
in interface SchemaType
SchemaType.DERIVATION_EXTENSION
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 declarationSchemaException
- if the derivation is not allowedpublic void setContainingDeclaration(StructuredQName declarationName, boolean isElement)
declarationName
- The name 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 StructuredQName getContainingDeclarationName()
public boolean containingDeclarationIsElement()
public boolean isSameType(SchemaType other)
isSameType
in interface SchemaType
other
- the other typepublic static boolean isSameURI(String s1, String s2)
s1
- the first URIs2
- the second URIprotected void registerExtensionType(UserComplexType derived)
derived
- the type that is derived from this one by extensionpublic Set<UserComplexType> getExtensionTypes()
public void setExtendedTypes(Set<UserComplexType> types)
types
- the set of extended typesCopyright (c) 2004-2014 Saxonica Limited. All rights reserved.