| java.lang.Object net.sf.saxon.type.BuiltInAtomicType
BuiltInAtomicType | public class BuiltInAtomicType implements AtomicType,Serializable(Code) | | This class represents a built-in atomic type, which may be either a primitive type
(such as xs:decimal or xs:anyURI) or a derived type (such as xs:ID or xdt:dayTimeDuration).
|
Method Summary | |
final public boolean | allowsDerivation(int derivation) | public 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. | public 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. | public Value | atomize(NodeInfo node) Get the typed value of a node that is annotated with this schema type.
The result of this method will always be consistent with the method
BuiltInAtomicType.getTypedValue . | public AtomicType | getAtomizedItemType() | final public SchemaType | getBaseType() Returns the base type that this type inherits from. | final public int | getBlock() | public SchemaType | getBuiltInBaseType() Returns the built-in base type this type is derived from. | public AtomicType | getCommonAtomicType() | final public int | getDerivationMethod() Gets the integer code of the derivation method used to derive this type from its
parent. | public String | getDescription() | public String | getDisplayName() | public int | getFingerprint() Get the fingerprint of the name of this type
the fingerprint. | public SchemaType | getKnownBaseType() Returns the base type that this type inherits from. | public int | getNameCode() Get the namecode of the name of this type. | public ItemType | getPrimitiveItemType() Get the primitive item type corresponding to this item type. | public int | getPrimitiveType() Get the primitive type corresponding to this item type. | public ItemType | getSuperType(TypeHierarchy th) Get the type from which this item type is derived by restriction. | final public SequenceIterator | getTypedValue(NodeInfo node) Get the typed value of a node that is annotated with this schema type
Parameters: node - the node whose typed value is required an iterator over the items making up the typed value of this node. | public SequenceIterator | getTypedValue(CharSequence value, NamespaceResolver resolver, NameChecker nameChecker) Get the typed value corresponding to a given string value, assuming it is
valid against this type
Parameters: value - the string value Parameters: resolver - a namespace resolver used to resolve any namespace prefixes appearingin the content of values. | final public int | getValidationStatus() | public int | getWhitespaceAction(TypeHierarchy th) | public boolean | isAllowedInBasicXSLT() | public boolean | isAtomicType() | final public boolean | isComplexType() | public boolean | isListType() | public boolean | isNamespaceSensitive() | public boolean | isSameType(SchemaType other) Test whether this is the same type as another type. | final public boolean | isSimpleType() | public void | isTypeDerivationOK(SchemaType type, int block) | public boolean | isUnionType() | public AtomicValue | makeDerivedValue(AtomicValue primValue, CharSequence lexicalValue, boolean validate) Factory method to create values of a derived atomic type. | public boolean | matchesItem(Item item, XPathContext context) | final public void | setBaseTypeFingerprint(int baseFingerprint) | public String | toString(NamePool pool) Produce a representation of this type name for use in error messages. | public String | toString() | public ValidationException | validateContent(CharSequence value, NamespaceResolver nsResolver, NameChecker nameChecker) Check whether a given input string is valid according to this SimpleType
Parameters: value - the input string to be checked Parameters: nsResolver - a namespace resolver used to resolve namespace prefixes if the typeis namespace sensitive. |
baseFingerprint | int baseFingerprint(Code) | | |
fingerprint | int fingerprint(Code) | | |
BuiltInAtomicType | public BuiltInAtomicType()(Code) | | |
BuiltInAtomicType | public BuiltInAtomicType(int fingerprint)(Code) | | |
allowsDerivation | final public boolean allowsDerivation(int derivation)(Code) | | Determines whether derivation (of a particular kind)
from this type is allowed, based on the "final" property
Parameters: derivation - the kind of derivation, for example SchemaType.DERIVATION_LIST true if this kind of derivation is allowed |
analyzeContentExpression | public static void analyzeContentExpression(SimpleType simpleType, Expression expression, StaticContext env, int kind) throws XPathException(Code) | | Analyze an expression to see whether the expression is capable of delivering a value of this
type.
Parameters: simpleType - the simple type against which the expression is to be checked Parameters: expression - the expression that delivers the content Parameters: kind - the node kind whose content is being delivered: Type.ELEMENT,Type.ATTRIBUTE, or Type.DOCUMENT throws: net.sf.saxon.trans.XPathException - if the expression will never deliver a value of the correct type |
atomize | public Value atomize(NodeInfo node) throws XPathException(Code) | | Get the typed value of a node that is annotated with this schema type.
The result of this method will always be consistent with the method
BuiltInAtomicType.getTypedValue . 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.
Parameters: node - the node whose typed value is required the typed value. since: 8.5 |
getAtomizedItemType | public AtomicType getAtomizedItemType()(Code) | | Get the item type of the atomic values that will be produced when an item
of this type is atomized
|
getBaseType | final public SchemaType getBaseType()(Code) | | 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.
the base type. throws: IllegalStateException - if this type is not valid. |
getBuiltInBaseType | public SchemaType getBuiltInBaseType() throws ValidationException(Code) | | Returns the built-in base type this type is derived from.
the first built-in type found when searching up the type hierarchy |
getCommonAtomicType | public AtomicType getCommonAtomicType()(Code) | | Get the most specific possible atomic type that all items in this SimpleType belong to
the lowest common supertype of all member types |
getDerivationMethod | final public int getDerivationMethod()(Code) | | Gets the integer code of the derivation method used to derive this type from its
parent. Returns zero for primitive types.
a numeric code representing the derivation method, for example SchemaType.DERIVATION_RESTRICTION |
getDisplayName | public String getDisplayName()(Code) | | Get the display name of the type: that is, a lexical QName with an arbitrary prefix
a lexical QName identifying the type |
getFingerprint | public int getFingerprint()(Code) | | Get the fingerprint of the name of this type
the fingerprint. Returns an invented fingerprint for an anonymous type. |
getKnownBaseType | public SchemaType getKnownBaseType()(Code) | | 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.
the base type. throws: IllegalStateException - if this type is not valid. |
getNameCode | public int getNameCode()(Code) | | Get the namecode of the name of this type. This includes the prefix from the original
type declaration: in the case of built-in types, there may be a conventional prefix
or there may be no prefix.
|
getPrimitiveItemType | public ItemType getPrimitiveItemType()(Code) | | Get the primitive item type corresponding to this item type. For item(),
this is Type.ITEM. For node(), it is Type.NODE. For specific node kinds,
it is the value representing the node kind, for example Type.ELEMENT.
For anyAtomicValue it is Type.ATOMIC_VALUE. For numeric it is Type.NUMBER.
For other atomic types it is the primitive type as defined in XML Schema,
except that INTEGER is considered to be a primitive type.
|
getPrimitiveType | public int getPrimitiveType()(Code) | | Get the primitive type corresponding to this item type. For item(),
this is Type.ITEM. For node(), it is Type.NODE. For specific node kinds,
it is the value representing the node kind, for example Type.ELEMENT.
For anyAtomicValue it is Type.ATOMIC_VALUE. For numeric it is Type.NUMBER.
For other atomic types it is the primitive type as defined in XML Schema,
except that INTEGER is considered to be a primitive type.
|
getSuperType | public ItemType getSuperType(TypeHierarchy th)(Code) | | Get the type from which this item type is derived by restriction. This
is the supertype in the XPath type heirarchy, as distinct from the Schema
base type: this means that the supertype of xs:boolean is xdt:anyAtomicType,
whose supertype is item() (rather than xs:anySimpleType).
the supertype, or null if this type is item() Parameters: th - |
getTypedValue | final public SequenceIterator getTypedValue(NodeInfo node) throws XPathException(Code) | | Get the typed value of a node that is annotated with this schema type
Parameters: node - the node whose typed value is required an iterator over the items making up the typed value of this node. The objectsreturned by this SequenceIterator will all be of type net.sf.saxon.value.AtomicValue |
getTypedValue | public SequenceIterator getTypedValue(CharSequence value, NamespaceResolver resolver, NameChecker nameChecker) throws ValidationException(Code) | | Get the typed value corresponding to a given string value, assuming it is
valid against this type
Parameters: value - the string value Parameters: resolver - a namespace resolver used to resolve any namespace prefixes appearingin the content of values. Can supply null, in which case any namespace-sensitive contentwill be rejected. Parameters: nameChecker - an iterator over the atomic sequence comprising the typed value. The objectsreturned by this SequenceIterator will all be of type net.sf.saxon.value.AtomicValue |
getValidationStatus | final public int getValidationStatus()(Code) | | Get the validation status - always valid
|
getWhitespaceAction | public int getWhitespaceAction(TypeHierarchy th)(Code) | | Determine the whitespace normalization required for values of this type
one of PRESERVE, REPLACE, COLLAPSE Parameters: th - |
isAllowedInBasicXSLT | public boolean isAllowedInBasicXSLT()(Code) | | Determine whether this type is supported in a basic XSLT processor
|
isAtomicType | public boolean isAtomicType()(Code) | | Test whether this Simple Type is an atomic type
true, this is an atomic type |
isComplexType | final public boolean isComplexType()(Code) | | Test whether this SchemaType is a complex type
true if this SchemaType is a complex type |
isListType | public boolean isListType()(Code) | | 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
true if this is a list type |
isNamespaceSensitive | public boolean isNamespaceSensitive()(Code) | | Test whether this simple type is namespace-sensitive, that is, whether
it is derived from xs:QName or xs:NOTATION
true if this type is derived from xs:QName or xs:NOTATION |
isSameType | public boolean isSameType(SchemaType other)(Code) | | 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)
|
isSimpleType | final public boolean isSimpleType()(Code) | | Returns true if this SchemaType is a SimpleType
true (always) |
isTypeDerivationOK | public void isTypeDerivationOK(SchemaType type, int block) throws SchemaException, ValidationException(Code) | | Check that this type is validly derived from a given type
Parameters: type - the type from which this type is derived Parameters: block - the derivations that are blocked by the relevant element declaration throws: SchemaException - if the derivation is not allowed |
isUnionType | public boolean isUnionType()(Code) | | Return true if this type is a union type (that is, if its variety is union)
true for a union type |
makeDerivedValue | public AtomicValue makeDerivedValue(AtomicValue primValue, CharSequence lexicalValue, boolean validate)(Code) | | Factory method to create values of a derived atomic type. This method
is not used to create values of a built-in type, even one that is not
primitive.
Parameters: primValue - the value in the value space of the primitive type Parameters: lexicalValue - the value in the lexical space. If null, the string value of primValue Parameters: validate - true if the value is to be validated against the facets of the derivedtype; false if the caller knows that the value is already valid. |
matchesItem | public boolean matchesItem(Item item, XPathContext context)(Code) | | Test whether a given item conforms to this type
Parameters: item - The item to be tested Parameters: context - true if the item is an instance of this type; false otherwise |
setBaseTypeFingerprint | final public void setBaseTypeFingerprint(int baseFingerprint)(Code) | | |
toString | public String toString(NamePool pool)(Code) | | Produce a representation of this type name for use in error messages.
Where this is a QName, it will use conventional prefixes
|
validateContent | public ValidationException validateContent(CharSequence value, NamespaceResolver nsResolver, NameChecker nameChecker)(Code) | | Check whether a given input string is valid according to this SimpleType
Parameters: value - the input string to be checked Parameters: nsResolver - a namespace resolver used to resolve namespace prefixes if the typeis namespace sensitive. The value supplied may be null; in this case any namespace-sensitivecontent will throw an UnsupportedOperationException. Parameters: nameChecker - XPathException if the value is invalid. Note that the exception is returned rather than being thrown.Returns null if the value is valid. throws: UnsupportedOperationException - if the type is namespace-sensitive and no namespaceresolver is supplied |
|
|