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
AtomicType. (Union types never arise
in non-schema-aware processing). There are concrete classes representing
built-in types such as
BuiltInListType: the corresponding classes for user-defined
types are in the
SequenceType ought logically to be in this package
but is actually in
net.sf.saxon.value. A sequence type contains
ItemType which may be an
AtomicType or a
NodeTest: NodeTests are found in the package
The logic for performing type checking is partly in the singleton class
Type (which also contains many useful constants), and partly in
TypeChecker found in package
Interface Summary Interface Description AtomicTypeInterface for atomic types (these are either built-in atomic types or user-defined atomic types). CastingTargetThis 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 type ComplexTypeA complex type as defined in XML Schema: either a user-defined complex type, or xs:anyType, or xs:untyped. ConversionResultThis is a marker interface used as the result of methods that convert or cast values from one type to another. FunctionItemTypeAn ItemType representing the type of a function item (subclasses are used for maps and arrays) HyperTypeAtomic 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. ItemTypeItemType is an interface that allows testing of whether an Item conforms to an expected type. ItemTypeWithSequenceTypeCacheExtension 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. ListTypeInterface representing a simple type of variety List PlainTypeA "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 types SchemaComponentThis is a marker interface that represents any "schema component" as defined in the XML Schema specification. SchemaDeclarationThis is a marker interface that acts as a surrogate for an object representing a global element or attribute declaration. SchemaTypeSchemaType is an interface implemented by all schema types: simple and complex types, built-in and user-defined types. SimpleTypeThis interface represents a simple type, which may be a built-in simple type, or a user-defined simple type. UnionTypeInterface representing a union type.
Class Summary Class Description AlphaCodeAn AlphaCode is a compact, context-independent string representation of a SequenceType AnyExternalObjectTypeThis class represents the type of an external object returned by an extension function, or supplied as an external variable/parameter. AnyFunctionTypeAn ItemType representing the type function(*). AnyFunctionTypeWithAssertionsThe item type function(*) when it is preceded by one or more annotation assertions AnyItemTypeAn implementation of ItemType that matches any item (node or atomic value) BuiltInAtomicTypeThis 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). BuiltInListTypeThis class is used to implement the built-in list types NMTOKENS, ENTITIES, IDREFS. BuiltInTypeThis 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. ConverterA converter implements conversions from one atomic type to another - that is, it implements the casting rules for a (source type, destination type) pair. Converter.Base64BinaryToHexBinaryConverts base64 to hexBinary Converter.BooleanToDecimalConverts a boolean to a decimal Converter.BooleanToDoubleConverts a boolean to a double Converter.BooleanToFloatConverts a boolean to an xs:float Converter.BooleanToIntegerConverts a boolean to an integer Converter.DateTimeToDateConverts a dateTime to a date Converter.DateTimeToGDayConverts a dateTime to a gDay Converter.DateTimeToGMonthConverts a dateTime to a gMonth Converter.DateTimeToGMonthDayConverts a dateTime to a gMonthDay Converter.DateTimeToGYearConverts a dateTime to a gYear Converter.DateTimeToGYearMonthConverts a dateTime to a gYearMonth Converter.DateTimeToTimeConverts a dateTime to a time Converter.DateToDateTimeConverts a date to a dateTime Converter.DecimalToIntegerConverts a decimal to an integer. Converter.DoubleToDecimalConvers a double to a decimal Converter.DoubleToIntegerConverts a double to an integer Converter.DownCastingConverterConverter that checks that a value belonging to a supertype is a valid instance of a subtype, and returns an instance of the subtype Converter.DurationToDayTimeDurationConverts a duration to a dayTimeDuration Converter.DurationToYearMonthDurationConverts a duration to a yearMonthDuration Converter.FloatToDecimalConverts a float to a decimal Converter.FloatToIntegerConverts a float to an integer Converter.HexBinaryToBase64BinaryConverts hexBinary to base64Binary Converter.IdentityConverterConverter that does nothing - it returns the input unchanged Converter.IntegerToDecimalConverts an integer to a decimal Converter.NotationToQNameConverts Notation to QName Converter.NumericToBooleanConverts a numeric value to a boolean Converter.NumericToDecimalConverts any numeric value to a decimal Converter.NumericToDoubleConverts any numeric value to a double. Converter.NumericToFloatConverts any numeric value to xs:float Converter.NumericToIntegerConverts any numeric value to an integer. Converter.PromoterToAnyURIConverter that implements the promotion rules from xs:string to xs:anyURI Converter.PromoterToBase64Binary Converter.PromoterToDoubleConverter that implements the promotion rules to a required type of xs:double Converter.PromoterToFloatConverter that implements the promotion rules to a required type of xs:float Converter.PromoterToHexBinaryConverter that implements the promotion rules from xs:string to xs:anyURI Converter.PromoterToStringConverter that implements the promotion rules from xs:anyURI to xs:string Converter.QNameToNotationConverts QName to Notation Converter.ToStringConverterConverts any value to a string Converter.ToUntypedAtomicConverterConverts any value to untyped atomic Converter.TwoPhaseConverterConverter that operates in two phases, via an intermediate type Converter.UnfailingConverterSpecialisation for converters that always succeed Converter.UpCastingConverterConverter that does nothing except change the type annotation of the value. Derivation EnumerationTypeProposed 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. ErrorTypeThis class has a singleton instance which represents the XML Schema 1.1 built-in type xs:error. ExternalObjectTypeThis class represents the type of an external object returned by an extension function, or supplied as an external variable/parameter. JavaExternalObjectTypeThis class represents the type of an external Java object returned by an extension function, or supplied as an external variable/parameter. LocalUnionTypeA 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. NumericTypeSingleton class representing the class xs:numeric as defined in XPath 3.1: a union type whose members are xs:double, xs:decimal, and xs:float SpecificFunctionTypeAn instance of this class represents a specific function item type, for example function(xs:int) as xs:boolean StringConverterA
Converterthat accepts a string as input.
StringConverter.StringToAnyURIConverts string to anyURI StringConverter.StringToBase64BinaryConverts string to base64 StringConverter.StringToBooleanConverts a string to a boolean StringConverter.StringToDateConverts a string to a date StringConverter.StringToDateTimeConverts a string to a dateTime StringConverter.StringToDateTimeStampConverts a string to a dateTimeStamp StringConverter.StringToDayTimeDurationConverts a string to a dayTimeDuration StringConverter.StringToDecimalConverts a string to an xs:decimal StringConverter.StringToDerivedStringSubtypeConverts from xs;string to a user-defined type derived from a built-in subtype of xs:string StringConverter.StringToDurationConverts a string to a duration StringConverter.StringToFloatConverts a string to xs:float StringConverter.StringToGDayConverts a string to a gDay StringConverter.StringToGMonthConverts a string to a gMonth StringConverter.StringToGMonthDayConverts a string to a gMonthDay StringConverter.StringToGYearConverts a string to a gYear StringConverter.StringToGYearMonthConverts a string to a gYearMonth StringConverter.StringToHexBinaryConverts a string to hexBinary StringConverter.StringToIntegerConverts a string to an integer StringConverter.StringToIntegerSubtypeConverts a string to a built-in subtype of integer StringConverter.StringToLanguageConverts from xs:string to xs:language StringConverter.StringToNameConverts from xs:string to xs:Name StringConverter.StringToNCNameConverts from xs:string to xs:NCName, xs:ID, xs:IDREF, or xs:ENTITY StringConverter.StringToNMTOKENConverts from xs:string to xs:NMTOKEN StringConverter.StringToNonStringDerivedTypeConverter 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.StringToNormalizedStringConverts from xs:string to xs:normalizedString StringConverter.StringToNotationConverts String to NOTATION StringConverter.StringToQNameConverts String to QName StringConverter.StringToStringConverts from xs:string or xs:untypedAtomic to xs:String StringConverter.StringToStringSubtypeConverts from xs:string to a user-defined type derived directly from xs:string StringConverter.StringToTimeConverts a string to a time StringConverter.StringToTokenConverts from xs:string to xs:token StringConverter.StringToUnionConverterConverter from string to plain union types StringConverter.StringToUntypedAtomicConverts from xs:string or xs:untypedAtomic to xs:untypedAtomic StringConverter.StringToYearMonthDurationConverts a string to a yearMonthDuration StringToDoubleThis class converts a string to an xs:double according to the rules in XML Schema 1.0 TypeThis class contains static information about types and methods for constructing type codes. TypeHierarchyThis class exists to provide answers to questions about the type hierarchy. UTypeA UType is a union of primitive (atomic, node, or function) item types. ValidationFailureThis exception indicates a failure when validating an instance against a type defined in a schema. ValidationParamsThis 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 AffinityA set of constants enumerating the possible relationships between one type and another AnySimpleTypeThis class has a singleton instance which represents the XML Schema built-in type xs:anySimpleType AnyTypeThis class has a singleton instance which represents the XML Schema built-in type xs:anyType, also known as the urtype. ComplexVarietyThe different varieties of complex types OpenContentVarietyThe different varieties of open content for complex types PrimitiveUType SchemaValidationStatusInternal indicator representing progress in validating components of a schema UntypedThis class has a singleton instance which represents the complex type xdt:untyped, used for elements that have not been validated.
Exception Summary Exception Description MissingComponentExceptionThis 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. SchemaExceptionAn exception that identifies an error in reading, parsing, or validating a schema. ValidationExceptionThis exception indicates a failure when validating an instance against a type defined in a schema.