public interface XQItemType extends XQSequenceType
XQItemType
interface represents an item type as defined in
XQuery 1.0: An XML Query language.
XQItemType
extends the XQSequenceType
but
restricts the occurrance indicator to be exactly one. This derivation allows passing
an item type wherever a sequence type is expected, but not the other way.
The XQItemType
interface contains methods to represent
information about the following aspects of an item type:
XQITEMKIND_*
constantsXQBASETYPE_*
constants. For atomic types this is the closest matching built-in XML
Schema type, for element and attributes the closest matching built-in XML
Schema type this node is based on.XQItemType
is a standalone
object that is independant of the XQConnection
and
any XQuery static or dynamic context.Modifier and Type | Field and Description |
---|---|
static int |
XQBASETYPE_ANYATOMICTYPE
Represents the schema type
xs:anyAtomicType |
static int |
XQBASETYPE_ANYSIMPLETYPE
Represents the schema type
xs:anySimpleType |
static int |
XQBASETYPE_ANYTYPE
Represents the schema type xs:anyType
|
static int |
XQBASETYPE_ANYURI
Represents the schema type
xs:anyURI |
static int |
XQBASETYPE_BASE64BINARY
Represents the schema type
xs:base64Binary |
static int |
XQBASETYPE_BOOLEAN
Represents the schema type
xs:boolean |
static int |
XQBASETYPE_BYTE
Represents the schema type
xs:byte |
static int |
XQBASETYPE_DATE
Represents the schema type
xs:date |
static int |
XQBASETYPE_DATETIME
Represents the schema type
xs:dateTime |
static int |
XQBASETYPE_DAYTIMEDURATION
Represents the schema type
xs:dayTimeDuration |
static int |
XQBASETYPE_DECIMAL
Represents the schema type
xs:decimal |
static int |
XQBASETYPE_DOUBLE
Represents the schema type
xs:double |
static int |
XQBASETYPE_DURATION
Represents the schema type
xs:duration |
static int |
XQBASETYPE_ENTITIES
Represents the schema type
xs:ENTITIES |
static int |
XQBASETYPE_ENTITY
Represents the schema type
xs:ENTITY |
static int |
XQBASETYPE_FLOAT
Represents the schema type
xs:float |
static int |
XQBASETYPE_GDAY
Represents the schema type
xs:gDay |
static int |
XQBASETYPE_GMONTH
Represents the schema type
xs:gMonth |
static int |
XQBASETYPE_GMONTHDAY
Represents the schema type
xs:gMonthDay |
static int |
XQBASETYPE_GYEAR
Represents the schema type
xs:gYear |
static int |
XQBASETYPE_GYEARMONTH
Represents the schema type
xs:gYearMonth |
static int |
XQBASETYPE_HEXBINARY
Represents the schema type
xs:hexBinary |
static int |
XQBASETYPE_ID
Represents the schema type
xs:ID |
static int |
XQBASETYPE_IDREF
Represents the schema type
xs:IDREF |
static int |
XQBASETYPE_IDREFS
Represents the schema type
xs:IDREFS . |
static int |
XQBASETYPE_INT
Represents the schema type
xs:int |
static int |
XQBASETYPE_INTEGER
Represents the schema type
xs:integer |
static int |
XQBASETYPE_LANGUAGE
Represents the schema type
xs:language |
static int |
XQBASETYPE_LONG
Represents the schema type
xs:long |
static int |
XQBASETYPE_NAME
Represents the schema type
xs:Name |
static int |
XQBASETYPE_NCNAME
Represents the schema type
xs:NCName |
static int |
XQBASETYPE_NEGATIVE_INTEGER
Represents the schema type
xs:negativeInteger |
static int |
XQBASETYPE_NMTOKEN
Represents the schema type
xs:NMToken |
static int |
XQBASETYPE_NMTOKENS
Represents the schema type
xs:NMTOKENS |
static int |
XQBASETYPE_NONNEGATIVE_INTEGER
Represents the schema type
xs:nonNegativeInteger |
static int |
XQBASETYPE_NONPOSITIVE_INTEGER
Represents the schema type
xs:nonPositiveInteger |
static int |
XQBASETYPE_NORMALIZED_STRING
Represents the schema type
xs:normalizedString |
static int |
XQBASETYPE_NOTATION
Represents the schema type
xs:NOTATION |
static int |
XQBASETYPE_POSITIVE_INTEGER
Represents the schema type
xs:positiveInteger |
static int |
XQBASETYPE_QNAME
Represents the schema type
xs:QName |
static int |
XQBASETYPE_SHORT
Represents the schema type
xs:short |
static int |
XQBASETYPE_STRING
Represents the schema type
xs:string |
static int |
XQBASETYPE_TIME
Represents the schema type
xs:time |
static int |
XQBASETYPE_TOKEN
Represents the schema type
xs:token |
static int |
XQBASETYPE_UNSIGNED_BYTE
Represents the schema type
xs:unsignedByte |
static int |
XQBASETYPE_UNSIGNED_INT
Represents the schema type
xs:unsignedInt |
static int |
XQBASETYPE_UNSIGNED_LONG
Represents the schema type
xs:unsignedLong |
static int |
XQBASETYPE_UNSIGNED_SHORT
Represents the schema type
xs:unsignedShort |
static int |
XQBASETYPE_UNTYPED
Represents the schema type xs:untyped
|
static int |
XQBASETYPE_UNTYPEDATOMIC
Represents the schema type
xs:untypedAtomic |
static int |
XQBASETYPE_YEARMONTHDURATION
Represents the schema type
xs:yearMonthDuration |
static int |
XQITEMKIND_ATOMIC
Some atomic type.
|
static int |
XQITEMKIND_ATTRIBUTE
Attribute node
|
static int |
XQITEMKIND_COMMENT
Comment node
|
static int |
XQITEMKIND_DOCUMENT
Document type (the type information represents the type of the document element)
|
static int |
XQITEMKIND_DOCUMENT_ELEMENT
Document node containing a single element node as its child
(type information represents type of the element child)
|
static int |
XQITEMKIND_DOCUMENT_SCHEMA_ELEMENT
Document node containing a single schema element node as its child
(type information represents type of the schema element child)
|
static int |
XQITEMKIND_ELEMENT
Element node
|
static int |
XQITEMKIND_ITEM
Any kind of item
|
static int |
XQITEMKIND_NODE
Some node type
|
static int |
XQITEMKIND_PI
Processing instruction node
|
static int |
XQITEMKIND_SCHEMA_ATTRIBUTE
Schema attribute node
|
static int |
XQITEMKIND_SCHEMA_ELEMENT
Schema element node
|
static int |
XQITEMKIND_TEXT
Text node
|
OCC_EMPTY, OCC_EXACTLY_ONE, OCC_ONE_OR_MORE, OCC_ZERO_OR_MORE, OCC_ZERO_OR_ONE
Modifier and Type | Method and Description |
---|---|
boolean |
equals(Object o)
Compares the specified object with this item type for equality.
|
int |
getBaseType()
Returns the base type of the item.
|
int |
getItemKind()
Returns the kind of the item.
|
int |
getItemOccurrence()
Returns the occurrence indicator for the item type.
|
QName |
getNodeName()
Returns the name of the node in case the item kind is an
XQITEMKIND_DOCUMENT_ELEMENT , XQITEMKIND_DOCUMENT_SCHEMA_ELEMENT ,
XQITEMKIND_ELEMENT , XQITEMKIND_SCHEMA_ELEMENT ,
XQITEMKIND_ATTRIBUTE , or XQITEMKIND_SCHEMA_ATTRIBUTE . |
String |
getPIName()
Returns the name of the processing instruction type.
|
URI |
getSchemaURI()
Returns the schema location URI of the schema that contains the item's
element or type definition.
|
QName |
getTypeName()
Represents a type name (global or local).
|
int |
hashCode()
Returns a hash code consistent with the definition of the equals method.
|
boolean |
isAnonymousType()
Represents whether the item type is an anonymous type in the schema.
|
boolean |
isElementNillable()
Returns whether the element type is nillable or not.
|
String |
toString()
Returns a human-readable implementation-defined
string representation of the item type.
|
getItemType
static final int XQITEMKIND_ATOMIC
static final int XQITEMKIND_ATTRIBUTE
static final int XQITEMKIND_COMMENT
static final int XQITEMKIND_DOCUMENT
static final int XQITEMKIND_DOCUMENT_ELEMENT
static final int XQITEMKIND_DOCUMENT_SCHEMA_ELEMENT
static final int XQITEMKIND_ELEMENT
static final int XQITEMKIND_ITEM
static final int XQITEMKIND_NODE
static final int XQITEMKIND_PI
static final int XQITEMKIND_TEXT
static final int XQITEMKIND_SCHEMA_ELEMENT
static final int XQITEMKIND_SCHEMA_ATTRIBUTE
static final int XQBASETYPE_UNTYPED
static final int XQBASETYPE_ANYTYPE
static final int XQBASETYPE_ANYSIMPLETYPE
xs:anySimpleType
static final int XQBASETYPE_ANYATOMICTYPE
xs:anyAtomicType
static final int XQBASETYPE_UNTYPEDATOMIC
xs:untypedAtomic
static final int XQBASETYPE_DAYTIMEDURATION
xs:dayTimeDuration
static final int XQBASETYPE_YEARMONTHDURATION
xs:yearMonthDuration
static final int XQBASETYPE_ANYURI
xs:anyURI
static final int XQBASETYPE_BASE64BINARY
xs:base64Binary
static final int XQBASETYPE_BOOLEAN
xs:boolean
static final int XQBASETYPE_DATE
xs:date
static final int XQBASETYPE_INT
xs:int
static final int XQBASETYPE_INTEGER
xs:integer
static final int XQBASETYPE_SHORT
xs:short
static final int XQBASETYPE_LONG
xs:long
static final int XQBASETYPE_DATETIME
xs:dateTime
static final int XQBASETYPE_DECIMAL
xs:decimal
static final int XQBASETYPE_DOUBLE
xs:double
static final int XQBASETYPE_DURATION
xs:duration
static final int XQBASETYPE_FLOAT
xs:float
static final int XQBASETYPE_GDAY
xs:gDay
static final int XQBASETYPE_GMONTH
xs:gMonth
static final int XQBASETYPE_GMONTHDAY
xs:gMonthDay
static final int XQBASETYPE_GYEAR
xs:gYear
static final int XQBASETYPE_GYEARMONTH
xs:gYearMonth
static final int XQBASETYPE_HEXBINARY
xs:hexBinary
static final int XQBASETYPE_NOTATION
xs:NOTATION
static final int XQBASETYPE_QNAME
xs:QName
static final int XQBASETYPE_STRING
xs:string
static final int XQBASETYPE_TIME
xs:time
static final int XQBASETYPE_BYTE
xs:byte
static final int XQBASETYPE_NONPOSITIVE_INTEGER
xs:nonPositiveInteger
static final int XQBASETYPE_NONNEGATIVE_INTEGER
xs:nonNegativeInteger
static final int XQBASETYPE_NEGATIVE_INTEGER
xs:negativeInteger
static final int XQBASETYPE_POSITIVE_INTEGER
xs:positiveInteger
static final int XQBASETYPE_UNSIGNED_LONG
xs:unsignedLong
static final int XQBASETYPE_UNSIGNED_INT
xs:unsignedInt
static final int XQBASETYPE_UNSIGNED_SHORT
xs:unsignedShort
static final int XQBASETYPE_UNSIGNED_BYTE
xs:unsignedByte
static final int XQBASETYPE_NORMALIZED_STRING
xs:normalizedString
static final int XQBASETYPE_TOKEN
xs:token
static final int XQBASETYPE_LANGUAGE
xs:language
static final int XQBASETYPE_NAME
xs:Name
static final int XQBASETYPE_NCNAME
xs:NCName
static final int XQBASETYPE_NMTOKEN
xs:NMToken
static final int XQBASETYPE_ID
xs:ID
static final int XQBASETYPE_IDREF
xs:IDREF
static final int XQBASETYPE_ENTITY
xs:ENTITY
static final int XQBASETYPE_IDREFS
xs:IDREFS
.
Valid only if the item kind is
XQITEMKIND_ELEMENT
, XQITEMKIND_DOCUMENT_ELEMENT
,
or XQITEMKIND_ATTRIBUTE
static final int XQBASETYPE_ENTITIES
xs:ENTITIES
static final int XQBASETYPE_NMTOKENS
xs:NMTOKENS
int getBaseType() throws XQException
XQBASETYPE_*
constants.
XQBASETYPE_*
constants
indicating the basic type of the itemXQException
- if the item kind is not one of:
XQITEMKIND_DOCUMENT_ELEMENT
,
XQITEMKIND_DOCUMENT_SCHEMA_ELEMENT
,
XQITEMKIND_ELEMENT
,
XQITEMKIND_SCHEMA_ELEMENT
,
XQITEMKIND_ATTRIBUTE
,
XQITEMKIND_SCHEMA_ATTRIBUTE
, or
XQITEMKIND_ATOMIC
int getItemKind()
XQITEMKIND_*
constants.XQITEMKIND_*
constants
indicating the basic kind of the itemint getItemOccurrence()
XQSequenceType.OCC_EXACTLY_ONE
.getItemOccurrence
in interface XQSequenceType
String toString()
toString
in interface XQSequenceType
toString
in class Object
QName getNodeName() throws XQException
XQITEMKIND_DOCUMENT_ELEMENT
, XQITEMKIND_DOCUMENT_SCHEMA_ELEMENT
,
XQITEMKIND_ELEMENT
, XQITEMKIND_SCHEMA_ELEMENT
,
XQITEMKIND_ATTRIBUTE
, or XQITEMKIND_SCHEMA_ATTRIBUTE
.
For example, in the case of a type for element "foo"
this will return the QName foo
. For wildcard entries a
null
value will be returned.QName
for the name of the element,
attribute, or document element node. null
if it is a wildcardXQException
- if the item kind is not one of:
XQITEMKIND_DOCUMENT_ELEMENT
,
XQITEMKIND_DOCUMENT_SCHEMA_ELEMENT
,
XQITEMKIND_ELEMENT
,
XQITEMKIND_SCHEMA_ELEMENT
,
XQITEMKIND_ATTRIBUTE
, or
XQITEMKIND_SCHEMA_ATTRIBUTE
URI getSchemaURI()
null
value if it does
not support retrieving the schema location URI.
If the item corresponds to a validated global element in a schema,
the result will be the schema location URI to the XMLSchema containing
the element definition. Otherwise if the item is a schema validated
node, the result will be the schema location URI of the XMLSchema
containing the type definition of that node. If the item is not schema
validated, the result is null
URI
representing the schema
location URI of the XMLSchema containing the
global element definition or the type definition
of the current item. null
in case
the item is not schema validated or if the
implementation does not support retrieving the
schema URI.QName getTypeName() throws XQException
QName
. If the return type is an
anonymous type, the actual QName
value returned is implementation
defined.QName
of the schema type in case of a
user defined or anonoymous types. For a built-in type,
returns a predefined type name as QName
(e.g.xs:anyType
, xs:decimal
,
etc). Cannot be null
XQException
- if the item kind is not one of:
XQITEMKIND_DOCUMENT_ELEMENT
,
XQITEMKIND_DOCUMENT_SCHEMA_ELEMENT
,
XQITEMKIND_ATOMIC
,
XQITEMKIND_ELEMENT
,
XQITEMKIND_SCHEMA_ELEMENT
,
XQITEMKIND_ATTRIBUTE
, or
XQITEMKIND_SCHEMA_ATTRIBUTE
boolean isAnonymousType()
true
if the item type is an anonymous
type in the schema, false
otherwiseboolean isElementNillable()
true
if the element type is nillable,
false
otherwiseString getPIName() throws XQException
XQItemType
must be XQITEMKIND_PI
.null
if it is a wildcardXQException
- if the item kind is not XQITEMKIND_PI
boolean equals(Object o)
true
only if the argument is an item type object which
represents the same XQuery item type.
equals
and
hashCode
across different implementations the following
algorithm must be used. Return true
if and only if both
objects are XQItemType
and:
getItemKind()
is equalgetBaseType()
is supported for
the item kind, it must be equalgetNodeName()
is supported for
the item kind, it must be equalgetSchemaURI()
is equalgetTypeName()
is supported for
the item kind, it must be equalisAnonymousType()
is equalisElementNillable()
is equalgetPIName()
is supported for the
item kind, it must be equalequals
in interface XQSequenceType
equals
in class Object
o
- an XQItemType
object representing an XQuery
item typetrue
if the input item type object represents
the same XQuery item type, false
otherwiseint hashCode()
equals
and
hashCode
across different implementations the following
algorithm must be used:
hashCode = this.getItemKind(); if this.getSchemaURI != null hashCode = 31*hashCode + this.getSchemaURI().hashCode(); if this.getBaseType() is supported for the item kind hashCode = 31*hashCode + this.getbaseType(); if this.getNodeName () is supported for the item kind and this.getNodeName() != null hashCode = 31*hashCode + this.getNodeName().hashCode() if this.getTypeName () is supported for the item kind hashCode = 31*hashCode + this.getTypeName().hashCode(); if this.getPIName () is supported for the item kind and this.getPIName () != null hashCode = 31*hashCode + this.getPIName().hashCode();
hashCode
in interface XQSequenceType
hashCode
in class Object
Copyright (c) 2004-2015 Saxonica Limited. All rights reserved.