Package net.sf.saxon.s9api
Class ItemType
- java.lang.Object
-
- net.sf.saxon.s9api.ItemType
-
- Direct Known Subclasses:
ConstructedItemType,ItemType.BuiltInAtomicItemType
public abstract class ItemType extends java.lang.ObjectAn item type, as defined in the XPath/XQuery specifications.This class contains a number of static constant fields referring to instances that represent simple item types, such as
item(),node(), andxs:anyAtomicType. These named types are currently based on the definitions in XSD 1.0 and XML 1.0. They may be changed in a future version to be based on a later version.More complicated item types, especially those that are dependent on information in a schema, are available using factory methods on the
ItemTypeFactoryobject. The factory methods can also be used to create variants of the types that use the rules given in the XML 1.1 and/or XSD 1.1 specifications.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description (package private) static classItemType.BuiltInAtomicItemType
-
Field Summary
Fields Modifier and Type Field Description static ItemTypeANY_ATOMIC_VALUEItemType representing the type xs:anyAtomicType, that is, any atomic valuestatic ItemTypeANY_ITEMItemType representing the type item(), that is, any item at allstatic ItemTypeANY_NODEItemType representing the type node(), that is, any nodestatic ItemTypeANY_URIItemType representing the primitive type xs:anyURIstatic ItemTypeBASE64_BINARYItemType representing the primitive type xs:base64Binarystatic ItemTypeBOOLEANItemType representing the primitive type xs:booleanstatic ItemTypeBYTEItemType representing the built-in (but non-primitive) type xs:bytestatic ItemTypeDATEItemType representing the primitive type xs:datestatic ItemTypeDATE_TIMEItemType representing the primitive type xs:dateTimestatic ItemTypeDATE_TIME_STAMPItemType representing the built-in (but non-primitive) type xs:dateTimeStamp (introduced in XSD 1.1)static ItemTypeDAY_TIME_DURATIONItemType representing the built-in (but non-primitive) type xs:dayTimeDurationstatic ItemTypeDECIMALItemType representing the primitive type xs:decimalstatic ItemTypeDOUBLEItemType representing the primitive type xs:doublestatic ItemTypeDURATIONItemType representing the primitive type xs:durationstatic ItemTypeENTITYItemType representing the built-in (but non-primitive) type xs:ENTITYstatic ItemTypeFLOATItemType representing the primitive type xs:floatstatic ItemTypeG_DAYItemType representing the primitive type xs:gDaystatic ItemTypeG_MONTHItemType representing the primitive type xs:gMonthstatic ItemTypeG_MONTH_DAYItemType representing the primitive type xs:gMonthDaystatic ItemTypeG_YEARItemType representing the primitive type xs:gYearstatic ItemTypeG_YEAR_MONTHItemType representing the primitive type xs:gYearMonthstatic ItemTypeHEX_BINARYItemType representing the primitive type xs:hexBinarystatic ItemTypeIDItemType representing the built-in (but non-primitive) type xs:IDstatic ItemTypeIDREFItemType representing the built-in (but non-primitive) type xs:IDREFstatic ItemTypeINTItemType representing the built-in (but non-primitive) type xs:intstatic ItemTypeINTEGERItemType representing the built-in (but non-primitive) type xs:integerstatic ItemTypeLANGUAGEItemType representing the built-in (but non-primitive) type xs:languagestatic ItemTypeLONGItemType representing the built-in (but non-primitive) type xs:longstatic ItemTypeNAMEItemType representing the built-in (but non-primitive) type xs:Namestatic ItemTypeNCNAMEItemType representing the built-in (but non-primitive) type xs:NCNamestatic ItemTypeNEGATIVE_INTEGERItemType representing the built-in (but non-primitive) type xs:negativeIntegerstatic ItemTypeNMTOKENItemType representing the built-in (but non-primitive) type xs:NMTOKENstatic ItemTypeNON_NEGATIVE_INTEGERItemType representing the built-in (but non-primitive) type xs:nonNegativeIntegerstatic ItemTypeNON_POSITIVE_INTEGERItemType representing the built-in (but non-primitive) type xs:nonPositiveIntegerstatic ItemTypeNORMALIZED_STRINGItemType representing the built-in (but non-primitive) type xs:normalizedStringstatic ItemTypeNOTATIONItemType representing the primitive type xs:NOTATIONstatic ItemTypeNUMERICA Saxon-specific item type representing the base type of double, float, and decimalstatic ItemTypePOSITIVE_INTEGERItemType representing the built-in (but non-primitive) type xs:positiveIntegerstatic ItemTypeQNAMEItemType representing the primitive type xs:QNamestatic ItemTypeSHORTItemType representing the built-in (but non-primitive) type xs:shortstatic ItemTypeSTRINGItemType representing the primitive type xs:stringstatic ItemTypeTIMEItemType representing the primitive type xs:timestatic ItemTypeTOKENItemType representing the built-in (but non-primitive) type xs:tokenstatic ItemTypeUNSIGNED_BYTEItemType representing the built-in (but non-primitive) type xs:unsignedBytestatic ItemTypeUNSIGNED_INTItemType representing the built-in (but non-primitive) type xs:unsignedIntstatic ItemTypeUNSIGNED_LONGItemType representing the built-in (but non-primitive) type xs:unsignedLongstatic ItemTypeUNSIGNED_SHORTItemType representing the built-in (but non-primitive) type xs:unsignedShortstatic ItemTypeUNTYPED_ATOMICItemType representing the XPath-defined type xs:untypedAtomicstatic ItemTypeYEAR_MONTH_DURATIONItemType representing the built-in (but non-primitive) type xs:yearMonthDuration
-
Constructor Summary
Constructors Constructor Description ItemType()
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description abstract ConversionRulesgetConversionRules()Get the conversion rules implemented by this type.abstract ItemTypegetUnderlyingItemType()Method to get the underlying Saxon implementation objectabstract 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_ITEM
public static ItemType ANY_ITEM
ItemType representing the type item(), that is, any item at all
-
ANY_NODE
public static final ItemType ANY_NODE
ItemType representing the type node(), that is, any node
-
ANY_ATOMIC_VALUE
public static final ItemType ANY_ATOMIC_VALUE
ItemType representing the type xs:anyAtomicType, that is, any atomic value
-
NUMERIC
public static final ItemType NUMERIC
A Saxon-specific item type representing the base type of double, float, and decimal
-
STRING
public static final ItemType STRING
ItemType representing the primitive type xs:string
-
BOOLEAN
public static final ItemType BOOLEAN
ItemType representing the primitive type xs:boolean
-
DURATION
public static final ItemType DURATION
ItemType representing the primitive type xs:duration
-
DATE_TIME
public static final ItemType DATE_TIME
ItemType representing the primitive type xs:dateTime
-
DATE
public static final ItemType DATE
ItemType representing the primitive type xs:date
-
TIME
public static final ItemType TIME
ItemType representing the primitive type xs:time
-
G_YEAR_MONTH
public static final ItemType G_YEAR_MONTH
ItemType representing the primitive type xs:gYearMonth
-
G_MONTH
public static final ItemType G_MONTH
ItemType representing the primitive type xs:gMonth
-
G_MONTH_DAY
public static final ItemType G_MONTH_DAY
ItemType representing the primitive type xs:gMonthDay
-
G_YEAR
public static final ItemType G_YEAR
ItemType representing the primitive type xs:gYear
-
G_DAY
public static final ItemType G_DAY
ItemType representing the primitive type xs:gDay
-
HEX_BINARY
public static final ItemType HEX_BINARY
ItemType representing the primitive type xs:hexBinary
-
BASE64_BINARY
public static final ItemType BASE64_BINARY
ItemType representing the primitive type xs:base64Binary
-
ANY_URI
public static final ItemType ANY_URI
ItemType representing the primitive type xs:anyURI
-
QNAME
public static final ItemType QNAME
ItemType representing the primitive type xs:QName
-
NOTATION
public static final ItemType NOTATION
ItemType representing the primitive type xs:NOTATION
-
UNTYPED_ATOMIC
public static final ItemType UNTYPED_ATOMIC
ItemType representing the XPath-defined type xs:untypedAtomic
-
DECIMAL
public static final ItemType DECIMAL
ItemType representing the primitive type xs:decimal
-
FLOAT
public static final ItemType FLOAT
ItemType representing the primitive type xs:float
-
DOUBLE
public static final ItemType DOUBLE
ItemType representing the primitive type xs:double
-
INTEGER
public static final ItemType INTEGER
ItemType representing the built-in (but non-primitive) type xs:integer
-
NON_POSITIVE_INTEGER
public static final ItemType NON_POSITIVE_INTEGER
ItemType representing the built-in (but non-primitive) type xs:nonPositiveInteger
-
NEGATIVE_INTEGER
public static final ItemType NEGATIVE_INTEGER
ItemType representing the built-in (but non-primitive) type xs:negativeInteger
-
LONG
public static final ItemType LONG
ItemType representing the built-in (but non-primitive) type xs:long
-
INT
public static final ItemType INT
ItemType representing the built-in (but non-primitive) type xs:int
-
SHORT
public static final ItemType SHORT
ItemType representing the built-in (but non-primitive) type xs:short
-
BYTE
public static final ItemType BYTE
ItemType representing the built-in (but non-primitive) type xs:byte
-
NON_NEGATIVE_INTEGER
public static final ItemType NON_NEGATIVE_INTEGER
ItemType representing the built-in (but non-primitive) type xs:nonNegativeInteger
-
POSITIVE_INTEGER
public static final ItemType POSITIVE_INTEGER
ItemType representing the built-in (but non-primitive) type xs:positiveInteger
-
UNSIGNED_LONG
public static final ItemType UNSIGNED_LONG
ItemType representing the built-in (but non-primitive) type xs:unsignedLong
-
UNSIGNED_INT
public static final ItemType UNSIGNED_INT
ItemType representing the built-in (but non-primitive) type xs:unsignedInt
-
UNSIGNED_SHORT
public static final ItemType UNSIGNED_SHORT
ItemType representing the built-in (but non-primitive) type xs:unsignedShort
-
UNSIGNED_BYTE
public static final ItemType UNSIGNED_BYTE
ItemType representing the built-in (but non-primitive) type xs:unsignedByte
-
YEAR_MONTH_DURATION
public static final ItemType YEAR_MONTH_DURATION
ItemType representing the built-in (but non-primitive) type xs:yearMonthDuration
-
DAY_TIME_DURATION
public static final ItemType DAY_TIME_DURATION
ItemType representing the built-in (but non-primitive) type xs:dayTimeDuration
-
NORMALIZED_STRING
public static final ItemType NORMALIZED_STRING
ItemType representing the built-in (but non-primitive) type xs:normalizedString
-
TOKEN
public static final ItemType TOKEN
ItemType representing the built-in (but non-primitive) type xs:token
-
LANGUAGE
public static final ItemType LANGUAGE
ItemType representing the built-in (but non-primitive) type xs:language
-
NAME
public static final ItemType NAME
ItemType representing the built-in (but non-primitive) type xs:Name
-
NMTOKEN
public static final ItemType NMTOKEN
ItemType representing the built-in (but non-primitive) type xs:NMTOKEN
-
NCNAME
public static final ItemType NCNAME
ItemType representing the built-in (but non-primitive) type xs:NCName
-
ID
public static final ItemType ID
ItemType representing the built-in (but non-primitive) type xs:ID
-
IDREF
public static final ItemType IDREF
ItemType representing the built-in (but non-primitive) type xs:IDREF
-
ENTITY
public static final ItemType ENTITY
ItemType representing the built-in (but non-primitive) type xs:ENTITY
-
DATE_TIME_STAMP
public static final ItemType DATE_TIME_STAMP
ItemType representing the built-in (but non-primitive) type xs:dateTimeStamp (introduced in XSD 1.1)
-
-
Method Detail
-
getConversionRules
public abstract ConversionRules getConversionRules()
Get the conversion rules implemented by this type. The conversion rules reflect variations between different versions of the W3C specifications, for example XSD 1.1 allows "+INF" as a lexical representation of xs:double, while XSD 1.0 does not.- Returns:
- the conversion rules
-
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
-
getUnderlyingItemType
public abstract ItemType getUnderlyingItemType()
Method to get the underlying Saxon implementation objectThis gives access to Saxon methods that may change from one release to another.
- Returns:
- the underlying Saxon implementation object
-
-