public class BuiltInAtomicType extends java.lang.Object implements AtomicType, java.io.Serializable
DERIVATION_EXTENSION, DERIVATION_LIST, DERIVATION_RESTRICTION, DERIVATION_UNION, DERIVE_BY_SUBSTITUTION
FIXED_UP, INCOMPLETE, INVALID, UNVALIDATED, VALIDATED, VALIDATING
?????? | ????? |
---|---|
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 expression to see whether the expression is capable of delivering a value of this
type.
|
static void |
analyzeContentExpression(SimpleType simpleType,
Expression expression,
StaticContext env,
int kind)
Analyze an expression to see whether the expression is capable of delivering a value of this
type.
|
Value |
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 |
equals(java.lang.Object obj)
Two types are equal if they have the same fingerprint.
|
AtomicType |
getAtomizedItemType()
Get the item type of the atomic values that will be produced when an item
of this type is atomized
|
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
SchemaType.DERIVATION_LIST and SchemaType.DERIVATION_EXTENSION |
SchemaType |
getBuiltInBaseType()
Returns the built-in base type this type is derived from.
|
AtomicType |
getCommonAtomicType()
Get the most specific possible atomic type that all items in this SimpleType belong to
|
int |
getDerivationMethod()
Gets the integer code of the derivation method used to derive this type from its
parent.
|
java.lang.String |
getDescription()
Get a description of this type for use in error messages.
|
java.lang.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
|
SchemaType |
getKnownBaseType()
Returns the base type that this type inherits from.
|
java.lang.String |
getName()
Get the local name of this type
|
int |
getNameCode()
Get the namecode of the name of this type.
|
ItemType |
getPrimitiveItemType()
Get the primitive item type corresponding to this item type.
|
int |
getPrimitiveType()
Get the primitive type corresponding to this item type.
|
StructuredQName |
getQualifiedName()
Get the name of the type as a QName
|
ItemType |
getSuperType(TypeHierarchy th)
Get the type from which this item type is derived by restriction.
|
java.lang.String |
getSystemId()
Get the URI of the schema document where the type was originally defined.
|
java.lang.String |
getTargetNamespace()
Get the target namespace of this type
|
SequenceIterator |
getTypedValue(java.lang.CharSequence value,
NamespaceResolver resolver,
NameChecker nameChecker)
Get the typed value corresponding to a given string value, assuming it is
valid against this type (and that the containing node is not nilled)
|
SequenceIterator |
getTypedValue(NodeInfo node)
Get the typed value of a node that is annotated with this schema type
|
int |
getValidationStatus()
Get the validation status - always valid
|
int |
getWhitespaceAction(TypeHierarchy th)
Determine the whitespace normalization required for values of this type
|
int |
hashCode()
The fingerprint can be used as a hashcode
|
boolean |
isAbstract()
Determine whether the type is abstract, that is, whether it cannot have instances that are not also
instances of some concrete subtype
|
boolean |
isAllowedInBasicXSLT()
Determine whether this type is supported in a basic XSLT processor
|
boolean |
isAnonymousType()
Test whether this is an anonymous type
|
boolean |
isAtomicType()
Test whether this Simple Type is an atomic type
|
boolean |
isBuiltInType()
Determine whether this is a built-in type or a user-defined 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 |
isListType()
Returns true if this type is derived by list, or if it is derived by restriction
from a list type, or if it is a union that contains a list as one of its members
|
boolean |
isNamespaceSensitive()
Test whether this simple type is namespace-sensitive, that is, whether
it is derived from xs:QName or xs:NOTATION
|
boolean |
isOrdered()
Determine whether the atomic type is ordered, that is, whether less-than and greater-than comparisons
are permitted
|
boolean |
isPrimitiveNumeric()
Determine whether the atomic type is numeric
|
boolean |
isPrimitiveType()
Determine whether the atomic type is a primitive type.
|
boolean |
isSameType(SchemaType other)
Test whether this is the same type as another type.
|
boolean |
isSimpleType()
Returns true if this SchemaType is a SimpleType
|
boolean |
isUnionType()
Return true if this type is a union type (that is, if its variety is union)
|
boolean |
matchesItem(Item item,
boolean allowURIPromotion,
Configuration config)
Test whether a given item conforms to this type
|
void |
setBaseTypeFingerprint(int baseFingerprint)
Set the base type of this type
|
java.lang.String |
toString() |
java.lang.String |
toString(NamePool pool)
Produce a representation of this type name for use in error messages.
|
ValidationFailure |
validate(AtomicValue primValue,
java.lang.CharSequence lexicalValue,
NameChecker checker)
Validate that a primitive atomic value is a valid instance of a type derived from the
same primitive type.
|
ValidationFailure |
validateContent(java.lang.CharSequence value,
NamespaceResolver nsResolver,
NameChecker nameChecker)
Check whether a given input string is valid according to this SimpleType
|
public static BuiltInAtomicType ANY_ATOMIC
public static BuiltInAtomicType NUMERIC
public static BuiltInAtomicType STRING
public static BuiltInAtomicType BOOLEAN
public static BuiltInAtomicType DURATION
public static BuiltInAtomicType DATE_TIME
public static BuiltInAtomicType DATE
public static BuiltInAtomicType TIME
public static BuiltInAtomicType G_YEAR_MONTH
public static BuiltInAtomicType G_MONTH
public static BuiltInAtomicType G_MONTH_DAY
public static BuiltInAtomicType G_YEAR
public static BuiltInAtomicType G_DAY
public static BuiltInAtomicType HEX_BINARY
public static BuiltInAtomicType BASE64_BINARY
public static BuiltInAtomicType ANY_URI
public static BuiltInAtomicType QNAME
public static BuiltInAtomicType NOTATION
public static BuiltInAtomicType UNTYPED_ATOMIC
public static BuiltInAtomicType DECIMAL
public static BuiltInAtomicType FLOAT
public static BuiltInAtomicType DOUBLE
public static BuiltInAtomicType INTEGER
public static BuiltInAtomicType NON_POSITIVE_INTEGER
public static BuiltInAtomicType NEGATIVE_INTEGER
public static BuiltInAtomicType LONG
public static BuiltInAtomicType INT
public static BuiltInAtomicType SHORT
public static BuiltInAtomicType BYTE
public static BuiltInAtomicType NON_NEGATIVE_INTEGER
public static BuiltInAtomicType POSITIVE_INTEGER
public static BuiltInAtomicType UNSIGNED_LONG
public static BuiltInAtomicType UNSIGNED_INT
public static BuiltInAtomicType UNSIGNED_SHORT
public static BuiltInAtomicType UNSIGNED_BYTE
public static BuiltInAtomicType YEAR_MONTH_DURATION
public static BuiltInAtomicType DAY_TIME_DURATION
public static BuiltInAtomicType NORMALIZED_STRING
public static BuiltInAtomicType TOKEN
public static BuiltInAtomicType LANGUAGE
public static BuiltInAtomicType NAME
public static BuiltInAtomicType NMTOKEN
public static BuiltInAtomicType NCNAME
public static BuiltInAtomicType ID
public static BuiltInAtomicType IDREF
public static BuiltInAtomicType ENTITY
public java.lang.String getName()
getName
???? SchemaType
public java.lang.String getTargetNamespace()
getTargetNamespace
???? SchemaType
public boolean isAbstract()
isAbstract
???? AtomicType
public boolean isExternalType()
isExternalType
???? SimpleType
public boolean isBuiltInType()
isBuiltInType
???? AtomicType
isBuiltInType
???? SimpleType
public boolean isOrdered()
isOrdered
???? AtomicType
public java.lang.String getSystemId()
getSystemId
???? SchemaType
public boolean isPrimitiveNumeric()
public AtomicType getCommonAtomicType()
getCommonAtomicType
???? SimpleType
public final int getValidationStatus()
getValidationStatus
???? SchemaComponent
SchemaComponent.UNVALIDATED
, SchemaComponent.VALIDATING
,
SchemaComponent.VALIDATED
, SchemaComponent.INVALID
, SchemaComponent.INCOMPLETE
public final int getBlock()
SchemaType.DERIVATION_LIST
and SchemaType.DERIVATION_EXTENSION
getBlock
???? SchemaType
public final int getDerivationMethod()
getDerivationMethod
???? SchemaType
SchemaType.DERIVATION_RESTRICTION
public final boolean allowsDerivation(int derivation)
allowsDerivation
???? SchemaType
derivation
- the kind of derivation, for example SchemaType.DERIVATION_LIST
public final void setBaseTypeFingerprint(int baseFingerprint)
baseFingerprint
- the namepool fingerprint of the name of the base typepublic int getFingerprint()
getFingerprint
???? SchemaType
public int getNameCode()
getNameCode
???? SchemaType
public StructuredQName getQualifiedName()
public java.lang.String getDisplayName()
getDisplayName
???? SchemaType
public boolean isPrimitiveType()
isPrimitiveType
???? AtomicType
public final boolean isComplexType()
isComplexType
???? SchemaType
public boolean isAnonymousType()
isAnonymousType
???? SchemaType
public final SchemaType getBaseType()
getBaseType
???? SchemaType
java.lang.IllegalStateException
- if this type is not valid.public boolean matchesItem(Item item, boolean allowURIPromotion, Configuration config)
matchesItem
???? ItemType
item
- The item to be testedallowURIPromotion
- true if we regard a URI as effectively a subtype of Stringconfig
- the Saxon configuration (used to locate the type hierarchy cache)public ItemType getSuperType(TypeHierarchy th)
getSuperType
???? ItemType
th
- the type hierarchy cache, not used in this implementationpublic ItemType getPrimitiveItemType()
getPrimitiveItemType
???? ItemType
public int getPrimitiveType()
getPrimitiveType
???? ItemType
public boolean isAllowedInBasicXSLT()
public java.lang.String toString(NamePool pool)
public AtomicType getAtomizedItemType()
getAtomizedItemType
???? ItemType
public SchemaType getKnownBaseType()
java.lang.IllegalStateException
- if this type is not valid.public boolean isSameType(SchemaType other)
isSameType
???? SchemaType
other
- the other typepublic java.lang.String getDescription()
SchemaType
getDescription
???? SchemaType
public java.lang.String toString()
toString
??? java.lang.Object
public void checkTypeDerivationIsOK(SchemaType type, int block) throws SchemaException
checkTypeDerivationIsOK
???? 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 final boolean isSimpleType()
isSimpleType
???? SchemaType
public boolean isAtomicType()
isAtomicType
???? ItemType
isAtomicType
???? SchemaType
isAtomicType
???? SimpleType
public boolean isListType()
isListType
???? SimpleType
public boolean isUnionType()
isUnionType
???? SimpleType
public int getWhitespaceAction(TypeHierarchy th)
getWhitespaceAction
???? SimpleType
th
- the type hierarchy cachepublic SchemaType getBuiltInBaseType()
getBuiltInBaseType
???? SimpleType
public boolean isNamespaceSensitive()
isNamespaceSensitive
???? SimpleType
public ValidationFailure validateContent(java.lang.CharSequence value, NamespaceResolver nsResolver, NameChecker nameChecker)
validateContent
???? SimpleType
value
- the input string to be checkednsResolver
- a namespace resolver used to resolve namespace prefixes if the type
is namespace sensitive. The value supplied may be null; in this case any namespace-sensitive
content will throw an UnsupportedOperationException.nameChecker
- XML 1.0 or 1.1 name checker. Must not be null.java.lang.UnsupportedOperationException
- if the type is namespace-sensitive and no namespace
resolver is suppliedpublic final SequenceIterator getTypedValue(NodeInfo node) throws XPathException
getTypedValue
???? SchemaType
node
- the node whose typed value is requiredAtomicValue
XPathException
public Value atomize(NodeInfo node) throws XPathException
getTypedValue(net.sf.saxon.om.NodeInfo)
. However, this method is often more convenient and may be
more efficient, especially in the common case where the value is expected to be a singleton.atomize
???? SchemaType
node
- the node whose typed value is requiredXPathException
public SequenceIterator getTypedValue(java.lang.CharSequence value, NamespaceResolver resolver, NameChecker nameChecker) throws ValidationException
getTypedValue
???? SimpleType
value
- the string valueresolver
- a namespace resolver used to resolve any namespace prefixes appearing
in the content of values. Can supply null, in which case any namespace-sensitive content
will be rejected.nameChecker
- XML 1.0 or 1.1 name checker. May be null if name checking is not requiredAtomicValue
ValidationException
- if the supplied value is not in the lexical space of the data typepublic boolean equals(java.lang.Object obj)
equals
??? java.lang.Object
public int hashCode()
hashCode
??? java.lang.Object
public ValidationFailure validate(AtomicValue primValue, java.lang.CharSequence lexicalValue, NameChecker checker)
validate
???? AtomicType
primValue
- the value in the value space of the primitive type.lexicalValue
- the value in the lexical space. If null, the string value of primValue
is used. This value is checked against the pattern facet (if any)checker
- Used to check names against XML 1.0 or XML 1.1 syntax rulesjava.lang.UnsupportedOperationException
- in the case of an external object typepublic void analyzeContentExpression(Expression expression, int kind, StaticContext env) throws XPathException
analyzeContentExpression
???? SchemaType
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 contextXPathException
- if the expression will never deliver a value of the correct typepublic static void analyzeContentExpression(SimpleType simpleType, Expression expression, StaticContext env, int kind) throws XPathException
simpleType
- the simple type against which the expression is to be checkedexpression
- the expression that delivers the contentenv
- the static context of the expressionkind
- the node kind whose content is being delivered: Type.ELEMENT
,
Type.ATTRIBUTE
, or Type.DOCUMENT
XPathException
- if the expression will never deliver a value of the correct type