public enum AnyType extends java.lang.Enum<AnyType> implements ComplexType
See XML Schema 1.1 Part 1 section 3.4.7
SchemaComponent.ValidationStatus
Enum Constant and Description |
---|
INSTANCE |
Modifier and Type | Field and Description |
---|---|
static StructuredQName |
QNAME |
OPEN_CONTENT_ABSENT, OPEN_CONTENT_INTERLEAVE, OPEN_CONTENT_NONE, OPEN_CONTENT_SUFFIX, VARIETY_ELEMENT_ONLY, VARIETY_EMPTY, VARIETY_MIXED, VARIETY_SIMPLE
DERIVATION_EXTENSION, DERIVATION_LIST, DERIVATION_RESTRICTION, DERIVATION_UNION, DERIVE_BY_SUBSTITUTION
COMPONENT_FUNCTION_TYPE
Modifier and Type | Method and Description |
---|---|
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.
|
boolean |
allowsDerivation(int derivation)
Determines whether derivation (of a particular kind)
from this type is allowed, based on the "final" property
|
void |
analyzeContentExpression(Expression expression,
int kind)
Analyze an expression to see whether the expression is capable of delivering a value of this
type.
|
AtomicSequence |
atomize(NodeInfo node)
Get the typed value of a node that is annotated with this schema type.
|
void |
checkTypeDerivationIsOK(SchemaType type,
int block)
Check that this type is validly derived from a given type
|
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
|
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.
|
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.
|
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.
|
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.
|
SchemaType |
getBaseType()
Get 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 |
Function |
getComponentAsFunction()
Get the schema component in the form of a function item.
|
int |
getDerivationMethod()
Gets the integer code of the derivation method used to derive this type from its
parent.
|
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.
|
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.
|
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 |
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.
|
int |
getElementParticleCardinality(StructuredQName elementName,
boolean considerExtensions)
Find an element particle within this complex type definition having a given element name
(identified by elementName), and return the cardinality associated with that element particle,
that is, the number of times the element can occur within this complex type.
|
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.
|
java.lang.String |
getEQName()
Get the name of this type as an EQName, that is, a string in the format Q{uri}local.
|
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
|
static AnyType |
getInstance()
Get the singular instance of this class
|
SchemaType |
getKnownBaseType()
Returns the base type that this type inherits from.
|
java.lang.String |
getName()
Get the local name of this type
|
int |
getRedefinitionLevel()
Get the redefinition level.
|
SimpleType |
getSimpleContentType()
For a complex type with simple content, return the simple type of the content.
|
StructuredQName |
getStructuredQName()
Get the name of the type as a StructuredQName
|
java.lang.String |
getSystemId()
Get the URI of the schema document containing the definition of this type
|
java.lang.String |
getTargetNamespace()
Get the target namespace of this type
|
SchemaComponent.ValidationStatus |
getValidationStatus()
Get the validation status - always valid
|
int |
getVariety()
Get the variety of this complex type.
|
boolean |
hasAssertions()
Ask whether there are any assertions defined on this complex type
|
boolean |
isAbstract()
Test whether this ComplexType has been marked as abstract.
|
boolean |
isAllContent()
Test whether this complex type has "all" content, that is, a content model
using an xs:all compositor
|
boolean |
isAnonymousType()
Test whether this is an anonymous type
|
boolean |
isAtomicType()
Test whether this SchemaType is an atomic type
|
boolean |
isComplexContent()
Test whether this complex type has complex content
|
boolean |
isComplexType()
Test whether this SchemaType is a complex type
|
boolean |
isEmptiable()
Test whether the content model of this complexType allows empty content
|
boolean |
isEmptyContent()
Test whether the content type of this complex type is empty
|
boolean |
isIdRefType()
Ask whether this type is an IDREF or IDREFS type.
|
boolean |
isIdType()
Ask whether this type is an ID type.
|
boolean |
isMixedContent()
Test whether this complex type allows mixed content
|
boolean |
isRestricted()
Test whether this complex type is derived by restriction
|
boolean |
isSameType(SchemaType other)
Test whether this is the same type as another type.
|
boolean |
isSimpleContent()
Test whether this complex type has simple content
|
boolean |
isSimpleType()
Test whether this SchemaType is a simple type
|
static AnyType |
valueOf(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.
|
clone, compareTo, equals, finalize, getDeclaringClass, hashCode, name, ordinal, toString, valueOf
getNearestNamedType
public static final AnyType INSTANCE
public static final StructuredQName QNAME
public static AnyType[] values()
for (AnyType c : AnyType.values()) System.out.println(c);
public static AnyType valueOf(java.lang.String name)
name
- the name of the enum constant to be returned.java.lang.IllegalArgumentException
- if this enum type has no constant with the specified namejava.lang.NullPointerException
- if the argument is nullpublic static AnyType getInstance()
public java.lang.String getName()
getName
in interface SchemaType
public java.lang.String getEQName()
getEQName
in interface SchemaType
public java.lang.String getTargetNamespace()
getTargetNamespace
in interface SchemaType
public int getVariety()
ComplexType.VARIETY_EMPTY
, ComplexType.VARIETY_MIXED
, ComplexType.VARIETY_SIMPLE
, or
ComplexType.VARIETY_ELEMENT_ONLY
getVariety
in interface ComplexType
public SchemaComponent.ValidationStatus getValidationStatus()
getValidationStatus
in interface SchemaComponent
SchemaComponent.ValidationStatus.UNVALIDATED
, SchemaComponent.ValidationStatus.VALIDATING
,
SchemaComponent.ValidationStatus.VALIDATED
, SchemaComponent.ValidationStatus.INVALID
, SchemaComponent.ValidationStatus.INCOMPLETE
public int getRedefinitionLevel()
getRedefinitionLevel
in interface SchemaComponent
public SchemaType getBaseType()
getBaseType
in interface SchemaType
public SchemaType getKnownBaseType() throws java.lang.IllegalStateException
java.lang.IllegalStateException
- if this type is not valid.public 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 Function getComponentAsFunction()
getComponentAsFunction
in interface SchemaComponent
public boolean isAbstract()
isAbstract
in interface ComplexType
public boolean isComplexType()
isComplexType
in interface SchemaType
public boolean isAnonymousType()
isAnonymousType
in interface SchemaType
public boolean isSimpleType()
isSimpleType
in interface SchemaType
public boolean isAtomicType()
isAtomicType
in interface SchemaType
public boolean isIdType()
isIdType
in interface SchemaType
public boolean isIdRefType()
isIdRefType
in interface SchemaType
public int getBlock()
SchemaType.DERIVATION_LIST
and SchemaType.DERIVATION_EXTENSION
getBlock
in interface SchemaType
public boolean isComplexContent()
isComplexContent
in interface ComplexType
public boolean isSimpleContent()
isSimpleContent
in interface ComplexType
public boolean isAllContent()
isAllContent
in interface ComplexType
public SimpleType getSimpleContentType()
getSimpleContentType
in interface ComplexType
public boolean isRestricted()
isRestricted
in interface ComplexType
public boolean isEmptyContent()
isEmptyContent
in interface ComplexType
public boolean isEmptiable()
isEmptiable
in interface ComplexType
public boolean isMixedContent()
isMixedContent
in interface ComplexType
public int getFingerprint()
getFingerprint
in interface SchemaType
public StructuredQName getStructuredQName()
getStructuredQName
in interface SchemaType
public java.lang.String getDescription()
getDescription
in interface SchemaType
public java.lang.String getDisplayName()
getDisplayName
in interface SchemaType
public java.lang.String getSystemId()
getSystemId
in interface SchemaType
public boolean isSameType(SchemaType other)
isSameType
in interface SchemaType
other
- the other typepublic void analyzeContentExpression(Expression expression, int kind)
analyzeContentExpression
in interface SchemaType
expression
- the expression that delivers the contentkind
- the node kind whose content is being delivered: Type.ELEMENT
,
Type.ATTRIBUTE
, or Type.DOCUMENT
public AtomicSequence atomize(NodeInfo node)
atomize
in interface SchemaType
node
- the node whose typed value is requiredpublic 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 SchemaType getElementParticleType(int elementName, boolean considerExtensions)
getElementParticleType
in interface ComplexType
elementName
- Identifies the name of the child element within this content modelconsiderExtensions
- true if the analysis should take into account types derived by extensionpublic int getElementParticleCardinality(int elementName, boolean considerExtensions)
StaticProperty.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.getElementParticleCardinality
in interface ComplexType
elementName
- Identifies the name of the child element within this content modelconsiderExtensions
- true if the analysis should take into account types derived by extensionStaticProperty.EMPTY
.public int getElementParticleCardinality(StructuredQName elementName, boolean considerExtensions)
ComplexType
StaticProperty.EXACTLY_ONE
, StaticProperty.ALLOWS_ZERO_OR_ONE
,
StaticProperty.ALLOWS_ZERO_OR_MORE
, StaticProperty.ALLOWS_ONE_OR_MORE
,
If there is no such particle, return StaticProperty.EMPTY
.getElementParticleCardinality
in interface ComplexType
elementName
- Identifies the name of the child element within this content modelconsiderExtensions
- True if types derived from this type by extension are to be included in the searchStaticProperty.EMPTY
.public SimpleType getAttributeUseType(StructuredQName attributeName)
getAttributeUseType
in interface ComplexType
attributeName
- Identifies the name of the child element within this content modelpublic int getAttributeUseCardinality(StructuredQName attributeName)
If there are types derived from this type by extension, search those too.
getAttributeUseCardinality
in interface ComplexType
attributeName
- Identifies the name of the child element within this content modelpublic boolean allowsAttributes()
allowsAttributes
in interface ComplexType
public void gatherAllPermittedChildren(IntHashSet children, boolean ignoreWildcards)
gatherAllPermittedChildren
in interface ComplexType
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 shouldignoreWildcards
- true if wildcards are to be ignored, rather than a wildcard causing the result to be consideredpublic void gatherAllPermittedDescendants(IntHashSet descendants)
gatherAllPermittedDescendants
in interface ComplexType
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.public SchemaType getDescendantElementType(int fingerprint)
getDescendantElementType
in interface ComplexType
fingerprint
- the name of the required descendant elementpublic int getDescendantElementCardinality(int elementFingerprint)
getDescendantElementCardinality
in interface ComplexType
elementFingerprint
- the name of the required descendant elementpublic boolean containsElementWildcard()
containsElementWildcard
in interface ComplexType
public boolean hasAssertions()
hasAssertions
in interface ComplexType
Copyright (c) 2004-2020 Saxonica Limited. All rights reserved.