public interface SchemaType extends SchemaComponent
There is a hierarchy of interfaces that extend SchemaType, representing the top levels of the schema type system: SimpleType and ComplexType, with SimpleType further subdivided into List, Union, and Atomic types.
The implementations of these interfaces are organized into a different hierarchy: on the one side, built-in types such as AnyType, AnySimpleType, and the built-in atomic types and list types; on the other side, user-defined types defined in a schema.
Modifier and Type | Field and Description |
---|---|
static int |
DERIVATION_EXTENSION
If the document's schema is an XML Schema [XML Schema Part 1]
, this constant represents the derivation by
extension.
|
static int |
DERIVATION_LIST
If the document's schema is an XML Schema [XML Schema Part 1]
, this constant represents the list.
|
static int |
DERIVATION_RESTRICTION
If the document's schema is an XML Schema [XML Schema Part 1]
, this constant represents the derivation by
restriction if complex types are involved, or a
restriction if simple types are involved.
|
static int |
DERIVATION_UNION
If the document's schema is an XML Schema [XML Schema Part 1]
, this constant represents the
union if simple types are involved.
|
static int |
DERIVE_BY_SUBSTITUTION
Derivation by substitution.
|
COMPONENT_FUNCTION_TYPE, FIXED_UP, INCOMPLETE, INVALID, UNVALIDATED, VALIDATED, VALIDATING
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 |
analyzeContentExpression(Expression expression,
int kind,
StaticContext env)
Analyze an XPath 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 base,
int block)
Check that this type is validly derived from a given type, following the rules for the Schema Component
Constraint "Is Type Derivation OK (Simple)" (3.14.6) or "Is Type Derivation OK (Complex)" (3.4.6) as
appropriate.
|
SchemaType |
getBaseType()
Returns the base type that this type inherits from.
|
int |
getBlock()
Returns the value of the 'block' attribute for this type, as a bit-significant
integer with fields such as
DERIVATION_LIST and DERIVATION_EXTENSION . |
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 error messages.
|
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.
|
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
|
int |
getNameCode()
Get the namecode of the name of this type.
|
String |
getSystemId()
Get the URI of the schema document where the type was originally defined.
|
String |
getTargetNamespace()
Get the target namespace of this type
|
boolean |
isAnonymousType()
Test whether this is an anonymous type
|
boolean |
isAtomicType()
Test whether this SchemaType is an atomic type
|
boolean |
isComplexType()
Test whether this SchemaType is a complex type
|
boolean |
isIdRefType()
Ask whether this type is an IDREF or IDREFS type.
|
boolean |
isIdType()
Ask whether this type is an ID type.
|
boolean |
isSameType(SchemaType other)
Test whether this is the same type as another type.
|
boolean |
isSimpleType()
Test whether this SchemaType is a simple type
|
getComponentAsFunction, getRedefinitionLevel, getValidationStatus
static final int DERIVATION_RESTRICTION
static final int DERIVATION_EXTENSION
static final int DERIVATION_UNION
DERIVATION_RESTRICTION
or
DERIVATION_EXTENSION
, T2 is derived from the other type
definition by DERIVATION_RESTRICTION
, T1 has {variety} union, and one of the {member type definitions} is T2. Note that T1 could be
the same as the reference type definition, and T2 could be the same
as the other type definition.static final int DERIVATION_LIST
DERIVATION_RESTRICTION
or
DERIVATION_EXTENSION
, T2 is derived from the other type
definition by DERIVATION_RESTRICTION
, T1 has {variety} list, and T2 is the {item type definition}. Note that T1 could be the same as
the reference type definition, and T2 could be the same as the other
type definition.static final int DERIVE_BY_SUBSTITUTION
String getName()
String getTargetNamespace()
int getNameCode()
int getFingerprint()
String getDisplayName()
String getEQName()
boolean isComplexType()
boolean isSimpleType()
boolean isAtomicType()
boolean isAnonymousType()
int getBlock()
DERIVATION_LIST
and DERIVATION_EXTENSION
.
This corresponds to the property "prohibited substitutions" in the schema component model.SchemaType getBaseType() throws UnresolvedReferenceException
IllegalStateException
- if this type is not valid.UnresolvedReferenceException
- if the reference from this type to its base
type cannot be resolved; this will generally make the schema unusable, but only
if the type is actually used.int getDerivationMethod()
DERIVATION_RESTRICTION
int getFinalProhibitions()
DERIVATION_EXTENSION
boolean allowsDerivation(int derivation)
derivation
- the kind of derivation, for example DERIVATION_LIST
void analyzeContentExpression(Expression expression, int kind, StaticContext env) throws XPathException
expression
- the expression that delivers the contentkind
- the node kind whose content is being delivered: Type.ELEMENT
,
Type.ATTRIBUTE
, or Type.DOCUMENT
env
- The static evaluation context for the query or stylesheetXPathException
- if the expression will never deliver a value of the correct typeAtomicSequence atomize(NodeInfo node) throws XPathException
node
- the node whose typed value is requiredXPathException
- if the node cannot be atomized, for example if this is a complex type
with element-only contentboolean isSameType(SchemaType other)
other
- the other typeString getDescription()
void checkTypeDerivationIsOK(SchemaType base, int block) throws SchemaException
base
- the base type; the algorithm tests whether derivation from this type is permittedblock
- the derivations that are blocked by the relevant element declarationSchemaException
- if the derivation is not allowedString getSystemId()
boolean isIdType()
boolean isIdRefType()
Copyright (c) 2004-2014 Saxonica Limited. All rights reserved.