Package net.sf.saxon.type
This package contains classes that implement the XPath 2.0 and 3.1 type system. It contains that part of the functionality relevant to a non-schema-aware implementation: that is, the overall structure of the type system, together with representations of the built-in types.
The hierarchy of schema types is represented by the interfaces
SchemaType
, ComplexType
, SimpleType
,
ListType
, and AtomicType
. (Union types never arise
in non-schema-aware processing). There are concrete classes representing
built-in types such as AnyType
, BuiltInAtomicType
,
and BuiltInListType
: the corresponding classes for user-defined
types are in the com.saxonica.schema
package.
The class SequenceType
ought logically to be in this package
but is actually in net.sf.saxon.value
. A sequence type contains
an ItemType
which may be an AtomicType
or a
NodeTest
: NodeTests are found in the package net.sf.saxon.pattern
.
The logic for performing type checking is partly in the singleton class
Type
(which also contains many useful constants), and partly in
the class TypeChecker
found in package net.sf.saxon.expr
.
-
Interface Summary Interface Description AtomicType Interface for atomic types (these are either built-in atomic types or user-defined atomic types).CastingTarget This marker interface represents a type that can be used as the target of a cast or castable operation, that is, an atomic type, list type, or plain union typeComplexType A complex type as defined in XML Schema: either a user-defined complex type, or xs:anyType, or xs:untyped.ConversionResult This is a marker interface used as the result of methods that convert or cast values from one type to another.FunctionItemType Higher-order functions in XPath 3.0 introduce a third kind of Item, namely a Function Item.HyperType Atomic types are the intersection of XPath item types and XSD simple types, and use multiple inheritance to inherit methods representing the characteristics of both these kinds.ItemType ItemType is an interface that allows testing of whether an Item conforms to an expected type.ItemTypeWithSequenceTypeCache Extension of the ItemType interface implemented by some item types, to provide a cache of SequenceType objects based on this item type, with different occurrence indicators.ListType Interface representing a simple type of variety ListPlainType A "plain type" is either an atomic type, or a union type that (a) imposes no restrictions other than those imposed by its member types, and (b) has exclusively plain types as its member typesSchemaComponent This is a marker interface that represents any "schema component" as defined in the XML Schema specification.SchemaDeclaration This is a marker interface that acts as a surrogate for an object representing a global element or attribute declaration.SchemaType SchemaType is an interface implemented by all schema types: simple and complex types, built-in and user-defined types.SimpleType This interface represents a simple type, which may be a built-in simple type, or a user-defined simple type.UnionType Interface representing a union type. -
Class Summary Class Description AlphaCode An AlphaCode is a compact, context-independent string representation of a SequenceTypeAnyExternalObjectType This class represents the type of an external object returned by an extension function, or supplied as an external variable/parameter.AnyFunctionType An ItemType representing the type function(*).AnyFunctionTypeWithAssertions The item type function(*) when it is preceded by one or more annotation assertionsAnyItemType An implementation of ItemType that matches any item (node or atomic value)BuiltInAtomicType 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 xs:dayTimeDuration).BuiltInListType This class is used to implement the built-in list types NMTOKENS, ENTITIES, IDREFS.BuiltInType This non-instantiable class acts as a register of Schema objects containing all the built-in types: that is, the types defined in the "xs" namespace.Converter A converter implements conversions from one atomic type to another - that is, it implements the casting rules for a (source type, destination type) pair.Converter.Base64BinaryToHexBinary Converts base64 to hexBinaryConverter.BooleanToDecimal Converts a boolean to a decimalConverter.BooleanToDouble Converts a boolean to a doubleConverter.BooleanToFloat Converts a boolean to an xs:floatConverter.BooleanToInteger Converts a boolean to an integerConverter.DateTimeToDate Converts a dateTime to a dateConverter.DateTimeToGDay Converts a dateTime to a gDayConverter.DateTimeToGMonth Converts a dateTime to a gMonthConverter.DateTimeToGMonthDay Converts a dateTime to a gMonthDayConverter.DateTimeToGYear Converts a dateTime to a gYearConverter.DateTimeToGYearMonth Converts a dateTime to a gYearMonthConverter.DateTimeToTime Converts a dateTime to a timeConverter.DateToDateTime Converts a date to a dateTimeConverter.DecimalToInteger Converts a decimal to an integer.Converter.DoubleToDecimal Convers a double to a decimalConverter.DoubleToInteger Converts a double to an integerConverter.DownCastingConverter Converter that checks that a value belonging to a supertype is a valid instance of a subtype, and returns an instance of the subtypeConverter.DurationToDayTimeDuration Converts a duration to a dayTimeDurationConverter.DurationToYearMonthDuration Converts a duration to a yearMonthDurationConverter.FloatToDecimal Converts a float to a decimalConverter.FloatToInteger Converts a float to an integerConverter.HexBinaryToBase64Binary Converts hexBinary to base64BinaryConverter.IdentityConverter Converter that does nothing - it returns the input unchangedConverter.IntegerToDecimal Converts an integer to a decimalConverter.NotationToQName Converts Notation to QNameConverter.NumericToBoolean Converts a numeric value to a booleanConverter.NumericToDecimal Converts any numeric value to a decimalConverter.NumericToDouble Converts any numeric value to a double.Converter.NumericToFloat Converts any numeric value to xs:floatConverter.NumericToInteger Converts any numeric value to an integer.Converter.PromoterToDouble Converter that implements the promotion rules to a required type of xs:doubleConverter.PromoterToFloat Converter that implements the promotion rules to a required type of xs:floatConverter.QNameToNotation Converts QName to NotationConverter.ToStringConverter Converts any value to a stringConverter.ToUntypedAtomicConverter Converts any value to untyped atomicConverter.TwoPhaseConverter Converter that operates in two phases, via an intermediate typeConverter.UnfailingConverter Specialisation for converters that always succeedConverter.UpCastingConverter Converter that does nothing except change the type annotation of the value.Derivation EnumerationType Proposed extension for XPath 4.0: an enumeration type is a way of defining a subtype of xs:string, with a defined set of permitted values, without recourse to a schema or schema-awareness.ErrorType This class has a singleton instance which represents the XML Schema 1.1 built-in type xs:error.ExternalObjectType This class represents the type of an external object returned by an extension function, or supplied as an external variable/parameter.JavaExternalObjectType This class represents the type of an external Java object returned by an extension function, or supplied as an external variable/parameter.LocalUnionType A class that represents a union type declared locally, for example using the (Saxon-extension) item-type syntax union(a,b,c), or internally in Java code.NumericType Singleton class representing the class xs:numeric as defined in XPath 3.1: a union type whose members are xs:double, xs:decimal, and xs:floatSpecificFunctionType An instance of this class represents a specific function item type, for example function(xs:int) as xs:booleanStringConverter AConverter
that accepts a string as input.StringConverter.StringToAnyURI Converts string to anyURIStringConverter.StringToBase64Binary Converts string to base64StringConverter.StringToBoolean Converts a string to a booleanStringConverter.StringToDate Converts a string to a dateStringConverter.StringToDateTime Converts a string to a dateTimeStringConverter.StringToDateTimeStamp Converts a string to a dateTimeStampStringConverter.StringToDayTimeDuration Converts a string to a dayTimeDurationStringConverter.StringToDecimal Converts a string to an xs:decimalStringConverter.StringToDerivedStringSubtype Converts from xs;string to a user-defined type derived from a built-in subtype of xs:stringStringConverter.StringToDuration Converts a string to a durationStringConverter.StringToFloat Converts a string to xs:floatStringConverter.StringToGDay Converts a string to a gDayStringConverter.StringToGMonth Converts a string to a gMonthStringConverter.StringToGMonthDay Converts a string to a gMonthDayStringConverter.StringToGYear Converts a string to a gYearStringConverter.StringToGYearMonth Converts a string to a gYearMonthStringConverter.StringToHexBinary Converts a string to hexBinaryStringConverter.StringToInteger Converts a string to an integerStringConverter.StringToIntegerSubtype Converts a string to a built-in subtype of integerStringConverter.StringToLanguage Converts from xs:string to xs:languageStringConverter.StringToName Converts from xs:string to xs:NameStringConverter.StringToNCName Converts from xs:string to xs:NCName, xs:ID, xs:IDREF, or xs:ENTITYStringConverter.StringToNMTOKEN Converts from xs:string to xs:NMTOKENStringConverter.StringToNonStringDerivedType Converter from string to a derived type (derived from a type other than xs:string), where the derived type needs to retain the original string for validating against lexical facets such as pattern.StringConverter.StringToNormalizedString Converts from xs:string to xs:normalizedStringStringConverter.StringToNotation Converts String to NOTATIONStringConverter.StringToQName Converts String to QNameStringConverter.StringToString Converts from xs:string or xs:untypedAtomic to xs:StringStringConverter.StringToStringSubtype Converts from xs:string to a user-defined type derived directly from xs:stringStringConverter.StringToTime Converts a string to a timeStringConverter.StringToToken Converts from xs:string to xs:tokenStringConverter.StringToUnionConverter Converter from string to plain union typesStringConverter.StringToUntypedAtomic Converts from xs:string or xs:untypedAtomic to xs:untypedAtomicStringConverter.StringToYearMonthDuration Converts a string to a yearMonthDurationStringToDouble This class converts a string to an xs:double according to the rules in XML Schema 1.0Type This class contains static information about types and methods for constructing type codes.TypeHierarchy This class exists to provide answers to questions about the type hierarchy.UType A UType is a union of primitive (atomic, node, or function) item types.ValidationFailure This exception indicates a failure when validating an instance against a type defined in a schema.ValidationParams This class represents a collection of parameter values for use in schema validation; it defines values for the parameters declared using the saxon:param XSD extension. -
Enum Summary Enum Description Affinity A set of constants enumerating the possible relationships between one type and anotherAnySimpleType This class has a singleton instance which represents the XML Schema built-in type xs:anySimpleTypeAnyType This class has a singleton instance which represents the XML Schema built-in type xs:anyType, also known as the urtype.ComplexVariety The different varieties of complex typesOpenContentVariety The different varieties of open content for complex typesPrimitiveUType SchemaValidationStatus Internal indicator representing progress in validating components of a schemaUntyped This class has a singleton instance which represents the complex type xdt:untyped, used for elements that have not been validated. -
Exception Summary Exception Description MissingComponentException This exception occurs when an attempt is made to dereference a reference from one schema component to another, if the target of the reference cannot be found.SchemaException An exception that identifies an error in reading, parsing, or validating a schema.ValidationException This exception indicates a failure when validating an instance against a type defined in a schema.