Package net.sf.saxon.type
Enum AnyType
- java.lang.Object
- 
- java.lang.Enum<AnyType>
- 
- net.sf.saxon.type.AnyType
 
 
- 
- All Implemented Interfaces:
- java.io.Serializable,- java.lang.Comparable<AnyType>,- ComplexType,- SchemaComponent,- SchemaType
 
 public enum AnyType extends java.lang.Enum<AnyType> implements ComplexType This class has a singleton instance which represents the XML Schema built-in type xs:anyType, also known as the urtype.See XML Schema 1.1 Part 1 section 3.4.7 
- 
- 
Nested Class Summary- 
Nested classes/interfaces inherited from interface net.sf.saxon.type.SchemaComponentSchemaComponent.ValidationStatus
 
- 
 - 
Enum Constant SummaryEnum Constants Enum Constant Description INSTANCE
 - 
Field SummaryFields Modifier and Type Field Description static StructuredQNameQNAME- 
Fields inherited from interface net.sf.saxon.type.ComplexTypeOPEN_CONTENT_ABSENT, OPEN_CONTENT_INTERLEAVE, OPEN_CONTENT_NONE, OPEN_CONTENT_SUFFIX, VARIETY_ELEMENT_ONLY, VARIETY_EMPTY, VARIETY_MIXED, VARIETY_SIMPLE
 - 
Fields inherited from interface net.sf.saxon.type.SchemaComponentCOMPONENT_FUNCTION_TYPE
 - 
Fields inherited from interface net.sf.saxon.type.SchemaTypeDERIVATION_EXTENSION, DERIVATION_LIST, DERIVATION_RESTRICTION, DERIVATION_UNION, DERIVE_BY_SUBSTITUTION
 
- 
 - 
Method SummaryAll Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanallowsAttributes()Return true if this type (or any known type derived from it by extension) allows the element to have one or more attributes.booleanallowsDerivation(int derivation)Determines whether derivation (of a particular kind) from this type is allowed, based on the "final" propertyvoidanalyzeContentExpression(Expression expression, int kind)Analyze an expression to see whether the expression is capable of delivering a value of this type.AtomicSequenceatomize(NodeInfo node)Get the typed value of a node that is annotated with this schema type.voidcheckTypeDerivationIsOK(SchemaType type, int block)Check that this type is validly derived from a given typebooleancontainsElementWildcard()Ask whether this type (or any known type derived from it by extension) allows the element to have children that match a wildcardvoidgatherAllPermittedChildren(IntHashSet children, boolean ignoreWildcards)Get a list of all the names of elements that can appear as children of an element having this complex type, as integer fingerprints.voidgatherAllPermittedDescendants(IntHashSet descendants)Get a list of all the names of elements that can appear as descendants of an element having this complex type, as integer fingerprints.intgetAttributeUseCardinality(StructuredQName attributeName)Find an attribute use within this complex type definition having a given attribute name (identified by fingerprint), and return the cardinality associated with that attribute, which will always be 0, 1, or 0-or-1.SimpleTypegetAttributeUseType(StructuredQName attributeName)Find an attribute use within this complex type definition having a given attribute name (identified by fingerprint), and return the schema type associated with that attribute.SchemaTypegetBaseType()Get the base typeintgetBlock()Returns the value of the 'block' attribute for this type, as a bit-signnificant integer with fields such asSchemaType.DERIVATION_LISTandSchemaType.DERIVATION_EXTENSIONFunctiongetComponentAsFunction()Get the schema component in the form of a function item.intgetDerivationMethod()Gets the integer code of the derivation method used to derive this type from its parent.intgetDescendantElementCardinality(int elementFingerprint)Assuming an element is a permitted descendant in the content model of this type, determine the cardinality of the element when it appears as a descendant.SchemaTypegetDescendantElementType(int fingerprint)Assuming an element is a permitted descendant in the content model of this type, determine the type of the element when it appears as a descendant.java.lang.StringgetDescription()Get a description of this type for use in diagnosticsjava.lang.StringgetDisplayName()Get the display name of the type: that is, a lexical QName with an arbitrary prefixintgetElementParticleCardinality(int elementName, boolean considerExtensions)Find an element particle within this complex type definition having a given element name (identified by fingerprint), and return the cardinality associated with that element particle, that is, the number of times the element can occur within this complex type.SchemaTypegetElementParticleType(int elementName, boolean considerExtensions)Find an element particle within this complex type definition having a given element name (identified by fingerprint), and return the schema type associated with that element particle.java.lang.StringgetEQName()Get the name of this type as an EQName, that is, a string in the format Q{uri}local.intgetFinalProhibitions()Get the types of derivation that are not permitted, by virtue of the "final" property.intgetFingerprint()Get the fingerprint of the name of this typestatic AnyTypegetInstance()Get the singular instance of this classSchemaTypegetKnownBaseType()Returns the base type that this type inherits from.java.lang.StringgetName()Get the local name of this typeintgetRedefinitionLevel()Get the redefinition level.SimpleTypegetSimpleContentType()For a complex type with simple content, return the simple type of the content.StructuredQNamegetStructuredQName()Get the name of the type as a StructuredQNamejava.lang.StringgetSystemId()Get the URI of the schema document containing the definition of this typejava.lang.StringgetTargetNamespace()Get the target namespace of this typeSchemaComponent.ValidationStatusgetValidationStatus()Get the validation status - always validintgetVariety()Get the variety of this complex type.booleanhasAssertions()Ask whether there are any assertions defined on this complex typebooleanisAbstract()Test whether this ComplexType has been marked as abstract.booleanisAllContent()Test whether this complex type has "all" content, that is, a content model using an xs:all compositorbooleanisAnonymousType()Test whether this is an anonymous typebooleanisAtomicType()Test whether this SchemaType is an atomic typebooleanisComplexContent()Test whether this complex type has complex contentbooleanisComplexType()Test whether this SchemaType is a complex typebooleanisEmptiable()Test whether the content model of this complexType allows empty contentbooleanisEmptyContent()Test whether the content type of this complex type is emptybooleanisIdRefType()Ask whether this type is an IDREF or IDREFS type.booleanisIdType()Ask whether this type is an ID type.booleanisMixedContent()Test whether this complex type allows mixed contentbooleanisRestricted()Test whether this complex type is derived by restrictionbooleanisSameType(SchemaType other)Test whether this is the same type as another type.booleanisSimpleContent()Test whether this complex type has simple contentbooleanisSimpleType()Test whether this SchemaType is a simple typestatic AnyTypevalueOf(java.lang.String name)Returns the enum constant of this type with the specified name.static AnyType[]values()Returns an array containing the constants of this enum type, in the order they are declared.- 
Methods inherited from class java.lang.Enumclone, compareTo, equals, finalize, getDeclaringClass, hashCode, name, ordinal, toString, valueOf
 - 
Methods inherited from interface net.sf.saxon.type.SchemaTypegetNearestNamedType
 
- 
 
- 
- 
- 
Enum Constant Detail- 
INSTANCEpublic static final AnyType INSTANCE 
 
- 
 - 
Field Detail- 
QNAMEpublic static final StructuredQName QNAME 
 
- 
 - 
Method Detail- 
valuespublic static AnyType[] values() Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:for (AnyType c : AnyType.values()) System.out.println(c); - Returns:
- an array containing the constants of this enum type, in the order they are declared
 
 - 
valueOfpublic static AnyType valueOf(java.lang.String name) Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)- Parameters:
- name- the name of the enum constant to be returned.
- Returns:
- the enum constant with the specified name
- Throws:
- java.lang.IllegalArgumentException- if this enum type has no constant with the specified name
- java.lang.NullPointerException- if the argument is null
 
 - 
getInstancepublic static AnyType getInstance() Get the singular instance of this class- Returns:
- the singular object representing xs:anyType
 
 - 
getNamepublic java.lang.String getName() Get the local name of this type- Specified by:
- getNamein interface- SchemaType
- Returns:
- the local name of this type definition, if it has one. Return null in the case of an anonymous type.
 
 - 
getEQNamepublic java.lang.String getEQName() Get the name of this type as an EQName, that is, a string in the format Q{uri}local.- Specified by:
- getEQNamein interface- SchemaType
- Returns:
- an EQName identifying the type, specifically "Q{http://www.w3.org/2001/XMLSchema}anyType"
 
 - 
getTargetNamespacepublic java.lang.String getTargetNamespace() Get the target namespace of this type- Specified by:
- getTargetNamespacein interface- SchemaType
- Returns:
- the target namespace of this type definition, if it has one. Return null in the case of an anonymous type, and in the case of a global type defined in a no-namespace schema.
 
 - 
getVarietypublic int getVariety() Get the variety of this complex type. This will be one of the valuesComplexType.VARIETY_EMPTY,ComplexType.VARIETY_MIXED,ComplexType.VARIETY_SIMPLE, orComplexType.VARIETY_ELEMENT_ONLY- Specified by:
- getVarietyin interface- ComplexType
 
 - 
getValidationStatuspublic SchemaComponent.ValidationStatus getValidationStatus() Get the validation status - always valid- Specified by:
- getValidationStatusin interface- SchemaComponent
- Returns:
- one of the values SchemaComponent.ValidationStatus.UNVALIDATED,SchemaComponent.ValidationStatus.VALIDATING,SchemaComponent.ValidationStatus.VALIDATED,SchemaComponent.ValidationStatus.INVALID,SchemaComponent.ValidationStatus.INCOMPLETE
 
 - 
getRedefinitionLevelpublic int getRedefinitionLevel() Get the redefinition level. This is zero for a component that has not been redefined; for a redefinition of a level-0 component, it is 1; for a redefinition of a level-N component, it is N+1. This concept is used to support the notion of "pervasive" redefinition: if a component is redefined at several levels, the top level wins, but it is an error to have two versions of the component at the same redefinition level.- Specified by:
- getRedefinitionLevelin interface- SchemaComponent
- Returns:
- the redefinition level
 
 - 
getBaseTypepublic SchemaType getBaseType() Get the base type- Specified by:
- getBaseTypein interface- SchemaType
- Returns:
- null (this is the root of the type hierarchy)
 
 - 
getKnownBaseTypepublic SchemaType getKnownBaseType() throws java.lang.IllegalStateException Returns the base type that this type inherits from. This method can be used to get the base type of a type that is known to be valid. If this type is a Simpletype that is a built in primitive type then null is returned.- Returns:
- the base type.
- Throws:
- java.lang.IllegalStateException- if this type is not valid.
 
 - 
getDerivationMethodpublic int getDerivationMethod() Gets the integer code of the derivation method used to derive this type from its parent. Returns zero for primitive types.- Specified by:
- getDerivationMethodin interface- SchemaType
- Returns:
- a numeric code representing the derivation method, for example
         SchemaType.DERIVATION_RESTRICTION
 
 - 
allowsDerivationpublic boolean allowsDerivation(int derivation) Determines whether derivation (of a particular kind) from this type is allowed, based on the "final" property- Specified by:
- allowsDerivationin interface- SchemaType
- Parameters:
- derivation- the kind of derivation, for example- SchemaType.DERIVATION_LIST
- Returns:
- true if this kind of derivation is allowed
 
 - 
getFinalProhibitionspublic int getFinalProhibitions() Get the types of derivation that are not permitted, by virtue of the "final" property.- Specified by:
- getFinalProhibitionsin interface- SchemaType
- Returns:
- the types of derivation that are not permitted, as a bit-significant integer
         containing bits such as SchemaType.DERIVATION_EXTENSION
 
 - 
getComponentAsFunctionpublic Function getComponentAsFunction() Get the schema component in the form of a function item. This allows schema information to be made visible to XSLT or XQuery code. The function makes available the contents of the schema component as defined in the XSD specification. The function takes a string as argument representing a property name, and returns the corresponding property of the schema component. There is also a property "class" which returns the kind of schema component, for example "Attribute Declaration".- Specified by:
- getComponentAsFunctionin interface- SchemaComponent
- Returns:
- the schema component represented as a function from property names to property values.
 
 - 
isAbstractpublic boolean isAbstract() Test whether this ComplexType has been marked as abstract.- Specified by:
- isAbstractin interface- ComplexType
- Returns:
- false: this class is not abstract.
 
 - 
isComplexTypepublic boolean isComplexType() Test whether this SchemaType is a complex type- Specified by:
- isComplexTypein interface- SchemaType
- Returns:
- true if this SchemaType is a complex type
 
 - 
isAnonymousTypepublic boolean isAnonymousType() Test whether this is an anonymous type- Specified by:
- isAnonymousTypein interface- SchemaType
- Returns:
- true if this SchemaType is an anonymous type
 
 - 
isSimpleTypepublic boolean isSimpleType() Test whether this SchemaType is a simple type- Specified by:
- isSimpleTypein interface- SchemaType
- Returns:
- true if this SchemaType is a simple type
 
 - 
isAtomicTypepublic boolean isAtomicType() Test whether this SchemaType is an atomic type- Specified by:
- isAtomicTypein interface- SchemaType
- Returns:
- true if this SchemaType is an atomic type
 
 - 
isIdTypepublic boolean isIdType() Ask whether this type is an ID type. This is defined to be any simple type who typed value may contain atomic values of type xs:ID: that is, it includes types derived from ID by restriction, list, or union. Note that for a node to be treated as an ID, its typed value must be a *single* atomic value of type ID; the type of the node, however, can still allow a list.- Specified by:
- isIdTypein interface- SchemaType
- Returns:
- true if this type is an ID type
 
 - 
isIdRefTypepublic boolean isIdRefType() Ask whether this type is an IDREF or IDREFS type. This is defined to be any simple type who typed value may contain atomic values of type xs:IDREF: that is, it includes types derived from IDREF or IDREFS by restriction, list, or union- Specified by:
- isIdRefTypein interface- SchemaType
- Returns:
- true if this type is an IDREF type
 
 - 
getBlockpublic int getBlock() Returns the value of the 'block' attribute for this type, as a bit-signnificant integer with fields such asSchemaType.DERIVATION_LISTandSchemaType.DERIVATION_EXTENSION- Specified by:
- getBlockin interface- SchemaType
- Returns:
- the value of the 'block' attribute for this type
 
 - 
isComplexContentpublic boolean isComplexContent() Test whether this complex type has complex content- Specified by:
- isComplexContentin interface- ComplexType
- Returns:
- true: this complex type has complex content
 
 - 
isSimpleContentpublic boolean isSimpleContent() Test whether this complex type has simple content- Specified by:
- isSimpleContentin interface- ComplexType
- Returns:
- false: this complex type has complex content
 
 - 
isAllContentpublic boolean isAllContent() Test whether this complex type has "all" content, that is, a content model using an xs:all compositor- Specified by:
- isAllContentin interface- ComplexType
- Returns:
- false: this complex type does not use an "all" compositor
 
 - 
getSimpleContentTypepublic SimpleType getSimpleContentType() For a complex type with simple content, return the simple type of the content. Otherwise, return null.- Specified by:
- getSimpleContentTypein interface- ComplexType
- Returns:
- null: this complex type does not have simple content
 
 - 
isRestrictedpublic boolean isRestricted() Test whether this complex type is derived by restriction- Specified by:
- isRestrictedin interface- ComplexType
- Returns:
- false: this type is not a restriction
 
 - 
isEmptyContentpublic boolean isEmptyContent() Test whether the content type of this complex type is empty- Specified by:
- isEmptyContentin interface- ComplexType
- Returns:
- false: the content model is not empty
 
 - 
isEmptiablepublic boolean isEmptiable() Test whether the content model of this complexType allows empty content- Specified by:
- isEmptiablein interface- ComplexType
- Returns:
- true: the content is allowed to be empty
 
 - 
isMixedContentpublic boolean isMixedContent() Test whether this complex type allows mixed content- Specified by:
- isMixedContentin interface- ComplexType
- Returns:
- true: mixed content is allowed
 
 - 
getFingerprintpublic int getFingerprint() Get the fingerprint of the name of this type- Specified by:
- getFingerprintin interface- SchemaType
- Returns:
- the fingerprint.
 
 - 
getStructuredQNamepublic StructuredQName getStructuredQName() Get the name of the type as a StructuredQName- Specified by:
- getStructuredQNamein interface- SchemaType
- Returns:
- a StructuredQName identifying the type. In the case of an anonymous type, an internally-generated name is returned
 
 - 
getDescriptionpublic java.lang.String getDescription() Get a description of this type for use in diagnostics- Specified by:
- getDescriptionin interface- SchemaType
- Returns:
- the string "xs:anyType"
 
 - 
getDisplayNamepublic java.lang.String getDisplayName() Get the display name of the type: that is, a lexical QName with an arbitrary prefix- Specified by:
- getDisplayNamein interface- SchemaType
- Returns:
- a lexical QName identifying the type
 
 - 
getSystemIdpublic java.lang.String getSystemId() Get the URI of the schema document containing the definition of this type- Specified by:
- getSystemIdin interface- SchemaType
- Returns:
- null for a built-in type
 
 - 
isSameTypepublic boolean isSameType(SchemaType other) Test whether this is the same type as another type. They are considered to be the same type if they are derived from the same type definition in the original XML representation (which can happen when there are multiple includes of the same file)- Specified by:
- isSameTypein interface- SchemaType
- Parameters:
- other- the other type
- Returns:
- true if this is the same type as other
 
 - 
analyzeContentExpressionpublic void analyzeContentExpression(Expression expression, int kind) Analyze an expression to see whether the expression is capable of delivering a value of this type.- Specified by:
- analyzeContentExpressionin interface- SchemaType
- Parameters:
- expression- the expression that delivers the content
- kind- the node kind whose content is being delivered:- Type.ELEMENT,- Type.ATTRIBUTE, or- Type.DOCUMENT
 
 - 
atomizepublic AtomicSequence atomize(NodeInfo node) Get the typed value of a node that is annotated with this schema type.- Specified by:
- atomizein interface- SchemaType
- Parameters:
- node- the node whose typed value is required
- Returns:
- the typed value.
- Since:
- 8.5
 
 - 
checkTypeDerivationIsOKpublic void checkTypeDerivationIsOK(SchemaType type, int block) throws SchemaException Check that this type is validly derived from a given type- Specified by:
- checkTypeDerivationIsOKin interface- SchemaType
- Parameters:
- type- the type from which this type is derived
- block- the derivations that are blocked by the relevant element declaration
- Throws:
- SchemaException- if the derivation is not allowed
 
 - 
getElementParticleTypepublic SchemaType getElementParticleType(int elementName, boolean considerExtensions) Find an element particle within this complex type definition having a given element name (identified by fingerprint), and return the schema type associated with that element particle. If there is no such particle, return null. If the fingerprint matches an element wildcard, return the type of the global element declaration with the given name if one exists, or AnyType if none exists and lax validation is permitted by the wildcard.- Specified by:
- getElementParticleTypein interface- ComplexType
- Parameters:
- elementName- Identifies the name of the child element within this content model
- considerExtensions- true if the analysis should take into account types derived by extension
- Returns:
- the schema type associated with the child element particle with the given name. If there is no such particle, return null.
 
 - 
getElementParticleCardinalitypublic int getElementParticleCardinality(int elementName, boolean considerExtensions)Find an element particle within this complex type definition having a given element name (identified by fingerprint), and return the cardinality associated with that element particle, that is, the number of times the element can occur within this complex type. The value is one ofStaticProperty.EXACTLY_ONE,StaticProperty.ALLOWS_ZERO_OR_ONE,StaticProperty.ALLOWS_ZERO_OR_MORE,StaticProperty.ALLOWS_ONE_OR_MORE, If there is no such particle, return zero.- Specified by:
- getElementParticleCardinalityin interface- ComplexType
- Parameters:
- elementName- Identifies the name of the child element within this content model
- considerExtensions- true if the analysis should take into account types derived by extension
- Returns:
- the cardinality associated with the child element particle with the given name.
         If there is no such particle, return StaticProperty.EMPTY.
 
 - 
getAttributeUseTypepublic SimpleType getAttributeUseType(StructuredQName attributeName) Find an attribute use within this complex type definition having a given attribute name (identified by fingerprint), and return the schema type associated with that attribute. If there is no such attribute use, return null. If the fingerprint matches an attribute wildcard, return the type of the global attribute declaration with the given name if one exists, or AnySimpleType if none exists and lax validation is permitted by the wildcard.- Specified by:
- getAttributeUseTypein interface- ComplexType
- Parameters:
- attributeName- Identifies the name of the child element within this content model
- Returns:
- the schema type associated with the attribute use identified by the fingerprint. If there is no such attribute use, return null.
 
 - 
getAttributeUseCardinalitypublic int getAttributeUseCardinality(StructuredQName attributeName) Find an attribute use within this complex type definition having a given attribute name (identified by fingerprint), and return the cardinality associated with that attribute, which will always be 0, 1, or 0-or-1. If there is no such attribute use, return null. If the fingerprint matches an attribute wildcard, return the type of the global attribute declaration with the given name if one exists, or AnySimpleType if none exists and lax validation is permitted by the wildcard.If there are types derived from this type by extension, search those too. - Specified by:
- getAttributeUseCardinalityin interface- ComplexType
- Parameters:
- attributeName- Identifies the name of the child element within this content model
- Returns:
- the schema type associated with the attribute use identified by the fingerprint. If there is no such attribute use, return null.
 
 - 
allowsAttributespublic boolean allowsAttributes() Return true if this type (or any known type derived from it by extension) allows the element to have one or more attributes.- Specified by:
- allowsAttributesin interface- ComplexType
- Returns:
- true if attributes are allowed
 
 - 
gatherAllPermittedChildrenpublic void gatherAllPermittedChildren(IntHashSet children, boolean ignoreWildcards) Get a list of all the names of elements that can appear as children of an element having this complex type, as integer fingerprints. If the list is unbounded (because of wildcards or the use of xs:anyType), return null.- Specified by:
- gatherAllPermittedChildrenin interface- ComplexType
- Parameters:
- children- an integer set, initially empty, which on return will hold the fingerprints of all permitted child elements; if the result contains the value -1, this indicates that it is not possible to enumerate all the children, typically because of wildcards. In this case the other contents of the set should
- ignoreWildcards- true if wildcards are to be ignored, rather than a wildcard causing the result to be considered
 
 - 
gatherAllPermittedDescendantspublic void gatherAllPermittedDescendants(IntHashSet descendants) Get a list of all the names of elements that can appear as descendants of an element having this complex type, as integer fingerprints. If the list is unbounded (because of wildcards or the use of xs:anyType), return null.- Specified by:
- gatherAllPermittedDescendantsin interface- ComplexType
- Parameters:
- descendants- an integer set, initially empty, which on return will hold the fingerprints of all permitted descendant elements; if the result contains the value -1, this indicates that it is not possible to enumerate all the descendants, typically because of wildcards. In this case the other contents of the set should be ignored.
 
 - 
getDescendantElementTypepublic SchemaType getDescendantElementType(int fingerprint) Assuming an element is a permitted descendant in the content model of this type, determine the type of the element when it appears as a descendant. If it appears with more than one type, return xs:anyType.- Specified by:
- getDescendantElementTypein interface- ComplexType
- Parameters:
- fingerprint- the name of the required descendant element
- Returns:
- the type of the descendant element; null if the element cannot appear as a descendant; anyType if it can appear with several different types
 
 - 
getDescendantElementCardinalitypublic int getDescendantElementCardinality(int elementFingerprint) Assuming an element is a permitted descendant in the content model of this type, determine the cardinality of the element when it appears as a descendant.- Specified by:
- getDescendantElementCardinalityin interface- ComplexType
- Parameters:
- elementFingerprint- the name of the required descendant element
- Returns:
- the cardinality of the descendant element within this complex type
 
 - 
containsElementWildcardpublic boolean containsElementWildcard() Ask whether this type (or any known type derived from it by extension) allows the element to have children that match a wildcard- Specified by:
- containsElementWildcardin interface- ComplexType
- Returns:
- true if the content model of this type, or its extensions, contains an element wildcard
 
 - 
hasAssertionspublic boolean hasAssertions() Ask whether there are any assertions defined on this complex type- Specified by:
- hasAssertionsin interface- ComplexType
- Returns:
- true if there are any assertions
 
 
- 
 
-