net.sf.saxon.type
public class BuiltInAtomicType extends Object implements AtomicType, Serializable
Method Summary | |
---|---|
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(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 DERIVATION_LIST and 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. |
String | getDescription() |
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. |
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
|
int | getRedefinitionLevel()
Get the redefinition level. |
ItemType | getSuperType(TypeHierarchy th)
Get the type from which this item type is derived by restriction. |
String | getSystemId()
Get the URI of the schema document where the type was originally defined.
|
String | getTargetNamespace()
Get the target namespace of this type
|
SequenceIterator | getTypedValue(NodeInfo node)
Get the typed value of a node that is annotated with this schema type
|
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 (and that the containing node is not nilled)
|
StructuredQName | getTypeName()
Get the name of this type as a StructuredQName, unless the type is anonymous, in which case
return null |
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 | isAllowedInXSD10()
Determine whether this type is supported when using XSD 1.0 |
boolean | isAnonymousType()
Test whether this is an anonymous type
|
boolean | isAtomicType()
Test whether this Simple Type is an atomic type
|
boolean | isAtomizable()
Ask whether values of this type are atomizable |
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 | isIdRefType()
Ask whether this type is an IDREF or IDREFS type. |
boolean | isIdType()
Ask whether this type is an ID type. |
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
|
CharSequence | postprocess(CharSequence input)
Reverse any pre-lexical facets, other than whitespace. |
CharSequence | preprocess(CharSequence input)
Apply any pre-lexical facets, other than whitespace. |
void | setBaseTypeFingerprint(int baseFingerprint)
Set the base type of this type
|
String | toString(NamePool pool)
Produce a representation of this type name for use in error messages.
|
String | toString() |
ValidationFailure | validate(AtomicValue primValue, 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(CharSequence value, NamespaceResolver nsResolver, NameChecker nameChecker)
Check whether a given input string is valid according to this SimpleType
|
Parameters: derivation the kind of derivation, for example DERIVATION_LIST
Returns: true if this kind of derivation is allowed
Parameters: expression the expression that delivers the content kind the node kind whose content is being delivered: ELEMENT, ATTRIBUTE, or DOCUMENT env the static context
Throws: net.sf.saxon.trans.XPathException if the expression will never deliver a value of the correct type
Parameters: simpleType the simple type against which the expression is to be checked expression the expression that delivers the content env the static context of the expression kind the node kind whose content is being delivered: ELEMENT, ATTRIBUTE, or DOCUMENT
Throws: net.sf.saxon.trans.XPathException if the expression will never deliver a value of the correct type
Parameters: node the node whose typed value is required
Returns: the typed value.
Since: 8.5
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
Returns: the base type.
Throws: IllegalStateException if this type is not valid.
Returns: the value of the 'block' attribute for this type
Returns: the first built-in type found when searching up the type hierarchy
Returns: the lowest common supertype of all member types
Returns: a numeric code representing the derivation method, for example DERIVATION_RESTRICTION
Returns: a lexical QName identifying the type
Returns: the fingerprint. Returns an invented fingerprint for an anonymous type.
Returns: the base type.
Throws: IllegalStateException if this type is not valid.
Returns: the local name of this type definition, if it has one. Return null in the case of an anonymous type.
Returns: a StructuredQName containing the name of the type. The conventional prefix "xs" is used to represent the XML Schema namespace
Returns: the redefinition level
Parameters: th the type hierarchy cache, not used in this implementation
Returns: the supertype, or null if this type is item()
Returns: the URI of the schema document. Returns null if the information is unknown or if this is a built-in type
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.
Parameters: node the node whose typed value is required
Returns: an iterator over the items making up the typed value of this node. The objects returned by this SequenceIterator will all be of type AtomicValue
Parameters: value the string value resolver 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 required
Returns: an iterator over the atomic sequence comprising the typed value. The objects returned by this SequenceIterator will all be of type AtomicValue
Returns: the name of the atomic type, or null if the type is anonymous.
Parameters: th the type hierarchy cache
Returns: one of PRESERVE, REPLACE, COLLAPSE
Returns: true if this type is permitted in a basic XSLT processor
Returns: true if this type is permitted in XSD 1.0
Returns: true if this SchemaType is an anonymous type
Returns: true, this is an atomic type
Returns: true unless it is known that these items will be elements with element-only content, in which case return false
Returns: true if this SchemaType is a complex type
Returns: true if this is a list type
Returns: true if this type is derived from xs:QName or xs:NOTATION
Returns: true if ordering operations are permitted
Returns: true if the type is a built-in numeric type
Returns: true if the type is considered primitive under the above rules
Returns: true (always)
Returns: true for a union type
Parameters: item The item to be tested allowURIPromotion true if we regard a URI as effectively a subtype of String config the Saxon configuration (used to locate the type hierarchy cache)
Returns: true if the item is an instance of this type; false otherwise
Parameters: input the value to be postprocessed: this is the "ordinary" result of converting the value to a string
Returns: the value after postprocessing
Parameters: input the value to be preprocessed
Returns: the value after preprocessing
Parameters: baseFingerprint the namepool fingerprint of the name of the base type
Parameters: 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 rules
Returns: null if the value is valid; otherwise, a ValidationFailure object indicating the nature of the error.
Throws: UnsupportedOperationException in the case of an external object type
Parameters: value the input string to be checked nsResolver 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.
Returns: 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 namespace resolver is supplied