net.sf.saxon.s9api

Class ItemType

public abstract class ItemType extends Object

An item type, as defined in the XPath/XQuery specifications.

This class contains a number of static properties to obtain instances representing simple item types, such as item(), node(), and xs:anyAtomicType.

More complicated item types, especially those that are dependent on information in a schema, are available using factory methods on the ItemTypeFactory object.

Field Summary
static ItemTypeANY_ATOMIC_VALUE
ItemType representing the type xs:anyAtomicType, that is, any atomic value
static ItemTypeANY_ITEM
ItemType representing the type item(), that is, any item at all
static ItemTypeANY_NODE
ItemType representing the type node(), that is, any node
static ItemTypeANY_URI
ItemType representing the primitive type xs:anyURI
static ItemTypeBASE64_BINARY
ItemType representing the primitive type xs:base64Binary
static ItemTypeBOOLEAN
ItemType representing the primitive type xs:boolean
static ItemTypeBYTE
ItemType representing the built-in (but non-primitive) type xs:byte
static ItemTypeDATE
ItemType representing the primitive type xs:date
static ItemTypeDATE_TIME
ItemType representing the primitive type xs:dateTime
static ItemTypeDATE_TIME_STAMP
ItemType representing the built-in (but non-primitive) type xs:dateTimeStamp (introduced in XSD 1.1)
static ItemTypeDAY_TIME_DURATION
ItemType representing the built-in (but non-primitive) type xs:dayTimeDuration
static ItemTypeDECIMAL
ItemType representing the primitive type xs:decimal
static ItemTypeDOUBLE
ItemType representing the primitive type xs:double
static ItemTypeDURATION
ItemType representing the primitive type xs:duration
static ItemTypeENTITY
ItemType representing the built-in (but non-primitive) type xs:ENTITY
static ItemTypeFLOAT
ItemType representing the primitive type xs:float
static ItemTypeG_DAY
ItemType representing the primitive type xs:gDay
static ItemTypeG_MONTH
ItemType representing the primitive type xs:gMonth
static ItemTypeG_MONTH_DAY
ItemType representing the primitive type xs:gMonthDay
static ItemTypeG_YEAR
ItemType representing the primitive type xs:gYear
static ItemTypeG_YEAR_MONTH
ItemType representing the primitive type xs:gYearMonth
static ItemTypeHEX_BINARY
ItemType representing the primitive type xs:hexBinary
static ItemTypeID
ItemType representing the built-in (but non-primitive) type xs:ID
static ItemTypeIDREF
ItemType representing the built-in (but non-primitive) type xs:IDREF
static ItemTypeINT
ItemType representing the built-in (but non-primitive) type xs:int
static ItemTypeINTEGER
ItemType representing the built-in (but non-primitive) type xs:integer
static ItemTypeLANGUAGE
ItemType representing the built-in (but non-primitive) type xs:language
static ItemTypeLONG
ItemType representing the built-in (but non-primitive) type xs:long
static ItemTypeNAME
ItemType representing the built-in (but non-primitive) type xs:Name
static ItemTypeNCNAME
ItemType representing the built-in (but non-primitive) type xs:NCName
static ItemTypeNEGATIVE_INTEGER
ItemType representing the built-in (but non-primitive) type xs:negativeInteger
static ItemTypeNMTOKEN
ItemType representing the built-in (but non-primitive) type xs:NMTOKEN
static ItemTypeNON_NEGATIVE_INTEGER
ItemType representing the built-in (but non-primitive) type xs:nonNegativeInteger
static ItemTypeNON_POSITIVE_INTEGER
ItemType representing the built-in (but non-primitive) type xs:nonPositiveInteger
static ItemTypeNORMALIZED_STRING
ItemType representing the built-in (but non-primitive) type xs:normalizedString
static ItemTypeNOTATION
ItemType representing the primitive type xs:NOTATION
static ItemTypeNUMERIC
A Saxon-specific item type representing the base type of double, float, and decimal
static ItemTypePOSITIVE_INTEGER
ItemType representing the built-in (but non-primitive) type xs:positiveInteger
static ItemTypeQNAME
ItemType representing the primitive type xs:QName
static ItemTypeSHORT
ItemType representing the built-in (but non-primitive) type xs:short
static ItemTypeSTRING
ItemType representing the primitive type xs:string
static ItemTypeTIME
ItemType representing the primitive type xs:time
static ItemTypeTOKEN
ItemType representing the built-in (but non-primitive) type xs:token
static ItemTypeUNSIGNED_BYTE
ItemType representing the built-in (but non-primitive) type xs:unsignedByte
static ItemTypeUNSIGNED_INT
ItemType representing the built-in (but non-primitive) type xs:unsignedInt
static ItemTypeUNSIGNED_LONG
ItemType representing the built-in (but non-primitive) type xs:unsignedLong
static ItemTypeUNSIGNED_SHORT
ItemType representing the built-in (but non-primitive) type xs:unsignedShort
static ItemTypeUNTYPED_ATOMIC
ItemType representing the XPath-defined type xs:untypedAtomic
static ItemTypeYEAR_MONTH_DURATION
ItemType representing the built-in (but non-primitive) type xs:yearMonthDuration
Method Summary
abstract ItemTypegetUnderlyingItemType()
Method to get the underlying Saxon implementation object

This gives access to Saxon methods that may change from one release to another.

abstract booleanmatches(XdmItem item)
Determine whether this item type matches a given item.
abstract booleansubsumes(ItemType other)
Determine whether this ItemType subsumes another ItemType.

Field Detail

ANY_ATOMIC_VALUE

public static ItemType ANY_ATOMIC_VALUE
ItemType representing the type xs:anyAtomicType, that is, any atomic value

ANY_ITEM

public static ItemType ANY_ITEM
ItemType representing the type item(), that is, any item at all

ANY_NODE

public static ItemType ANY_NODE
ItemType representing the type node(), that is, any node

ANY_URI

public static ItemType ANY_URI
ItemType representing the primitive type xs:anyURI

BASE64_BINARY

public static ItemType BASE64_BINARY
ItemType representing the primitive type xs:base64Binary

BOOLEAN

public static ItemType BOOLEAN
ItemType representing the primitive type xs:boolean

BYTE

public static ItemType BYTE
ItemType representing the built-in (but non-primitive) type xs:byte

DATE

public static ItemType DATE
ItemType representing the primitive type xs:date

DATE_TIME

public static ItemType DATE_TIME
ItemType representing the primitive type xs:dateTime

DATE_TIME_STAMP

public static ItemType DATE_TIME_STAMP
ItemType representing the built-in (but non-primitive) type xs:dateTimeStamp (introduced in XSD 1.1)

DAY_TIME_DURATION

public static ItemType DAY_TIME_DURATION
ItemType representing the built-in (but non-primitive) type xs:dayTimeDuration

DECIMAL

public static ItemType DECIMAL
ItemType representing the primitive type xs:decimal

DOUBLE

public static ItemType DOUBLE
ItemType representing the primitive type xs:double

DURATION

public static ItemType DURATION
ItemType representing the primitive type xs:duration

ENTITY

public static ItemType ENTITY
ItemType representing the built-in (but non-primitive) type xs:ENTITY

FLOAT

public static ItemType FLOAT
ItemType representing the primitive type xs:float

G_DAY

public static ItemType G_DAY
ItemType representing the primitive type xs:gDay

G_MONTH

public static ItemType G_MONTH
ItemType representing the primitive type xs:gMonth

G_MONTH_DAY

public static ItemType G_MONTH_DAY
ItemType representing the primitive type xs:gMonthDay

G_YEAR

public static ItemType G_YEAR
ItemType representing the primitive type xs:gYear

G_YEAR_MONTH

public static ItemType G_YEAR_MONTH
ItemType representing the primitive type xs:gYearMonth

HEX_BINARY

public static ItemType HEX_BINARY
ItemType representing the primitive type xs:hexBinary

ID

public static ItemType ID
ItemType representing the built-in (but non-primitive) type xs:ID

IDREF

public static ItemType IDREF
ItemType representing the built-in (but non-primitive) type xs:IDREF

INT

public static ItemType INT
ItemType representing the built-in (but non-primitive) type xs:int

INTEGER

public static ItemType INTEGER
ItemType representing the built-in (but non-primitive) type xs:integer

LANGUAGE

public static ItemType LANGUAGE
ItemType representing the built-in (but non-primitive) type xs:language

LONG

public static ItemType LONG
ItemType representing the built-in (but non-primitive) type xs:long

NAME

public static ItemType NAME
ItemType representing the built-in (but non-primitive) type xs:Name

NCNAME

public static ItemType NCNAME
ItemType representing the built-in (but non-primitive) type xs:NCName

NEGATIVE_INTEGER

public static ItemType NEGATIVE_INTEGER
ItemType representing the built-in (but non-primitive) type xs:negativeInteger

NMTOKEN

public static ItemType NMTOKEN
ItemType representing the built-in (but non-primitive) type xs:NMTOKEN

NON_NEGATIVE_INTEGER

public static ItemType NON_NEGATIVE_INTEGER
ItemType representing the built-in (but non-primitive) type xs:nonNegativeInteger

NON_POSITIVE_INTEGER

public static ItemType NON_POSITIVE_INTEGER
ItemType representing the built-in (but non-primitive) type xs:nonPositiveInteger

NORMALIZED_STRING

public static ItemType NORMALIZED_STRING
ItemType representing the built-in (but non-primitive) type xs:normalizedString

NOTATION

public static ItemType NOTATION
ItemType representing the primitive type xs:NOTATION

NUMERIC

public static ItemType NUMERIC
A Saxon-specific item type representing the base type of double, float, and decimal

POSITIVE_INTEGER

public static ItemType POSITIVE_INTEGER
ItemType representing the built-in (but non-primitive) type xs:positiveInteger

QNAME

public static ItemType QNAME
ItemType representing the primitive type xs:QName

SHORT

public static ItemType SHORT
ItemType representing the built-in (but non-primitive) type xs:short

STRING

public static ItemType STRING
ItemType representing the primitive type xs:string

TIME

public static ItemType TIME
ItemType representing the primitive type xs:time

TOKEN

public static ItemType TOKEN
ItemType representing the built-in (but non-primitive) type xs:token

UNSIGNED_BYTE

public static ItemType UNSIGNED_BYTE
ItemType representing the built-in (but non-primitive) type xs:unsignedByte

UNSIGNED_INT

public static ItemType UNSIGNED_INT
ItemType representing the built-in (but non-primitive) type xs:unsignedInt

UNSIGNED_LONG

public static ItemType UNSIGNED_LONG
ItemType representing the built-in (but non-primitive) type xs:unsignedLong

UNSIGNED_SHORT

public static ItemType UNSIGNED_SHORT
ItemType representing the built-in (but non-primitive) type xs:unsignedShort

UNTYPED_ATOMIC

public static ItemType UNTYPED_ATOMIC
ItemType representing the XPath-defined type xs:untypedAtomic

YEAR_MONTH_DURATION

public static ItemType YEAR_MONTH_DURATION
ItemType representing the built-in (but non-primitive) type xs:yearMonthDuration

Method Detail

getUnderlyingItemType

public abstract ItemType getUnderlyingItemType()
Method to get the underlying Saxon implementation object

This gives access to Saxon methods that may change from one release to another.

Returns: the underlying Saxon implementation object

matches

public abstract boolean matches(XdmItem item)
Determine whether this item type matches a given item.

Parameters: item the item to be tested against this item type

Returns: true if the item matches this item type, false if it does not match.

subsumes

public abstract boolean subsumes(ItemType other)
Determine whether this ItemType subsumes another ItemType. Specifically, A.subsumes(B) is true if every value that matches the ItemType B also matches the ItemType A.

Parameters: other the other ItemType

Returns: true if this ItemType subsumes the other ItemType. This includes the case where A and B represent the same ItemType.

Since: 9.1