Public Member Functions | Static Public Attributes | Protected Member Functions | List of all members
org.zorbaxquery.api.xqj.ZorbaXQItemType Class Reference

The ZorbaXQItemType class represents an item type as defined in XQuery 1.0: An XML Query language. More...

Inherits XQItemType.

Public Member Functions

boolean equals (Object o)
 Compares the specified object with this item type for equality. More...
 
int getBaseType () throws XQException
 Returns the base type of the item. More...
 
int getItemKind ()
 Returns the kind of the item. More...
 
int getItemOccurrence ()
 Returns the occurrence indicator for the item type. More...
 
ZorbaXQItemType getItemType ()
 Returns the type of the item in the sequence type. More...
 
QName getNodeName () throws XQException
 Returns the name of the node. More...
 
String getPIName () throws XQException
 Returns the name of the processing instruction type. More...
 
URI getSchemaURI ()
 Returns the schema location URI of the schema that contains the item's element or type definition. More...
 
QName getTypeName () throws XQException
 Represents a type name (global or local). More...
 
int hashCode ()
 Returns a hash code consistent with the definition of the equals method. More...
 
boolean isAnonymousType ()
 Represents whether the item type is an anonymous type in the schema. More...
 
boolean isElementNillable ()
 Returns whether the element type is nillable or not. More...
 
String toString ()
 Returns a human-readable implementation-defined string representation of the item type. More...
 
 ZorbaXQItemType (TypeIdentifier typeIdentifier)
 
 ZorbaXQItemType (Item zorbaItem)
 
 ZorbaXQItemType (int itemkind, String piTarget)
 
 ZorbaXQItemType (int itemkind)
 
 ZorbaXQItemType (int itemkind, int basetype)
 
 ZorbaXQItemType (int itemkind, QName nodename, int basetype)
 
 ZorbaXQItemType (int itemkind, QName nodename, int basetype, QName typename, URI schemaURI, boolean allowNill) throws XQException
 
 ZorbaXQItemType (int itemkind, QName nodename, int basetype, URI schemaURI) throws XQException
 

Static Public Attributes

static final int ZORBA_XQITEMKIND_ANY = 0
 
static final int ZORBA_XQITEMKIND_ATTRIBUTE = 3
 
static final int ZORBA_XQITEMKIND_COMMENT = 6
 
static final int ZORBA_XQITEMKIND_DOCUMENT = 1
 
static final int ZORBA_XQITEMKIND_ELEMENT = 2
 
static final int ZORBA_XQITEMKIND_PI = 5
 
static final int ZORBA_XQITEMKIND_TEXT = 4
 

Protected Member Functions

TypeIdentifier getTypeIdentifier () throws XQException
 

Detailed Description

The ZorbaXQItemType class represents an item type as defined in XQuery 1.0: An XML Query language.

The ZorbaXQItemType 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 ZorbaXQItemType interface contains methods to represent information about the following aspects of an item type:

An instance of the ZorbaXQItemType is a standalone object that is independant of the XQConnection and any XQuery static or dynamic context.

Definition at line 38 of file ZorbaXQItemType.java.

Constructor & Destructor Documentation

org.zorbaxquery.api.xqj.ZorbaXQItemType.ZorbaXQItemType ( TypeIdentifier  typeIdentifier)
inline

Definition at line 96 of file ZorbaXQItemType.java.

Referenced by org.zorbaxquery.api.xqj.ZorbaXQItemType.equals().

org.zorbaxquery.api.xqj.ZorbaXQItemType.ZorbaXQItemType ( Item  zorbaItem)
inline
org.zorbaxquery.api.xqj.ZorbaXQItemType.ZorbaXQItemType ( int  itemkind,
String  piTarget 
)
inline

Definition at line 375 of file ZorbaXQItemType.java.

org.zorbaxquery.api.xqj.ZorbaXQItemType.ZorbaXQItemType ( int  itemkind)
inline

Definition at line 380 of file ZorbaXQItemType.java.

org.zorbaxquery.api.xqj.ZorbaXQItemType.ZorbaXQItemType ( int  itemkind,
int  basetype 
)
inline

Definition at line 384 of file ZorbaXQItemType.java.

org.zorbaxquery.api.xqj.ZorbaXQItemType.ZorbaXQItemType ( int  itemkind,
QName  nodename,
int  basetype 
)
inline

Definition at line 389 of file ZorbaXQItemType.java.

org.zorbaxquery.api.xqj.ZorbaXQItemType.ZorbaXQItemType ( int  itemkind,
QName  nodename,
int  basetype,
QName  typename,
URI  schemaURI,
boolean  allowNill 
) throws XQException
inline

Definition at line 395 of file ZorbaXQItemType.java.

org.zorbaxquery.api.xqj.ZorbaXQItemType.ZorbaXQItemType ( int  itemkind,
QName  nodename,
int  basetype,
URI  schemaURI 
) throws XQException
inline

Definition at line 403 of file ZorbaXQItemType.java.

Member Function Documentation

boolean org.zorbaxquery.api.xqj.ZorbaXQItemType.equals ( Object  o)
inline

Compares the specified object with this item type for equality.

The result is true only if the argument is an item type object which represents the same XQuery item type.

In order to comply with the general contract of equals and hashCode across different implementations the following algorithm must be used. Return true if and only if both objects are ZorbaXQItemType and:

Parameters
o- an ZorbaXQItemType object representing an XQuery item type
Returns
true if the input item type object represents the same XQuery item type, false otherwise

Definition at line 735 of file ZorbaXQItemType.java.

References org.zorbaxquery.api.xqj.ZorbaXQItemType.getBaseType(), org.zorbaxquery.api.xqj.ZorbaXQItemType.getItemKind(), org.zorbaxquery.api.xqj.ZorbaXQItemType.getNodeName(), org.zorbaxquery.api.xqj.ZorbaXQItemType.getPIName(), org.zorbaxquery.api.xqj.ZorbaXQItemType.getSchemaURI(), org.zorbaxquery.api.xqj.ZorbaXQItemType.getTypeName(), org.zorbaxquery.api.xqj.ZorbaXQItemType.isAnonymousType(), org.zorbaxquery.api.xqj.ZorbaXQItemType.isElementNillable(), and org.zorbaxquery.api.xqj.ZorbaXQItemType.ZorbaXQItemType().

int org.zorbaxquery.api.xqj.ZorbaXQItemType.getBaseType ( ) throws XQException
inline

Returns the base type of the item.

One of the XQBASETYPE_* constants.

XQJ defines a constant for each of the built-in schema types defined in XML Schema. 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.

Returns
int one of the XQBASETYPE_* constants indicating the basic type of the item
Exceptions
XQException- 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

Definition at line 588 of file ZorbaXQItemType.java.

Referenced by org.zorbaxquery.api.xqj.ZorbaXQItemType.equals(), and org.zorbaxquery.api.xqj.ZorbaXQItemType.hashCode().

int org.zorbaxquery.api.xqj.ZorbaXQItemType.getItemKind ( )
inline

Returns the kind of the item.

One of the XQITEMKIND_* constants.

Returns
int one of the XQITEMKIND_* constants indicating the basic kind of the item

Definition at line 608 of file ZorbaXQItemType.java.

Referenced by org.zorbaxquery.api.xqj.ZorbaXQItemType.equals(), and org.zorbaxquery.api.xqj.ZorbaXQItemType.hashCode().

int org.zorbaxquery.api.xqj.ZorbaXQItemType.getItemOccurrence ( )
inline

Returns the occurrence indicator for the item type.

This method will always return the value XQSequenceType.OCC_EXACTLY_ONE.

Returns
int indicating the occurrence indicator

Definition at line 619 of file ZorbaXQItemType.java.

ZorbaXQItemType org.zorbaxquery.api.xqj.ZorbaXQItemType.getItemType ( )
inline

Returns the type of the item in the sequence type.

Returns
ZorbaXQItemType representing the item type in the sequence. null is returned in case of an empty sequence.

Definition at line 713 of file ZorbaXQItemType.java.

QName org.zorbaxquery.api.xqj.ZorbaXQItemType.getNodeName ( ) throws XQException
inline

Returns the name of the node.

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. 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.

Returns
QName for the name of the element, attribute, or document element node. null if it is a wildcard
Exceptions
XQException- 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

Definition at line 631 of file ZorbaXQItemType.java.

Referenced by org.zorbaxquery.api.xqj.ZorbaXQItemType.equals(), and org.zorbaxquery.api.xqj.ZorbaXQItemType.hashCode().

String org.zorbaxquery.api.xqj.ZorbaXQItemType.getPIName ( ) throws XQException
inline

Returns the name of the processing instruction type.

As such the item kind of this ZorbaXQItemType must be XQITEMKIND_PI.

Returns
the name of the processing instruction type. null if it is a wildcard.
Exceptions
XQException- if the item kind is not XQITEMKIND_PI

Definition at line 701 of file ZorbaXQItemType.java.

Referenced by org.zorbaxquery.api.xqj.ZorbaXQItemType.equals(), and org.zorbaxquery.api.xqj.ZorbaXQItemType.hashCode().

URI org.zorbaxquery.api.xqj.ZorbaXQItemType.getSchemaURI ( )
inline

Returns the schema location URI of the schema that contains the item's element or type definition.

This method is implementation-definied and an implementation will return a 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.

Returns
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.

Definition at line 650 of file ZorbaXQItemType.java.

Referenced by org.zorbaxquery.api.xqj.ZorbaXQItemType.equals(), and org.zorbaxquery.api.xqj.ZorbaXQItemType.hashCode().

TypeIdentifier org.zorbaxquery.api.xqj.ZorbaXQItemType.getTypeIdentifier ( ) throws XQException
inlineprotected

Definition at line 55 of file ZorbaXQItemType.java.

QName org.zorbaxquery.api.xqj.ZorbaXQItemType.getTypeName ( ) throws XQException
inline

Represents a type name (global or local).

This can be used to represent specific type name such as, element foo of type hatsize. The schema type name is represented as a single QName. If the return type is an anonymous type, the actual QName value returned is implementation defined.

Returns
the 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.
Exceptions
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

Definition at line 662 of file ZorbaXQItemType.java.

Referenced by org.zorbaxquery.api.xqj.ZorbaXQItemType.equals(), and org.zorbaxquery.api.xqj.ZorbaXQItemType.hashCode().

int org.zorbaxquery.api.xqj.ZorbaXQItemType.hashCode ( )
inline

Returns a hash code consistent with the definition of the equals method.

In order to comply with the general contract of equals and hashCode across different implementations the following algorithm must be used:

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();
Returns
hash code for this item type

Definition at line 796 of file ZorbaXQItemType.java.

References org.zorbaxquery.api.xqj.ZorbaXQItemType.getBaseType(), org.zorbaxquery.api.xqj.ZorbaXQItemType.getItemKind(), org.zorbaxquery.api.xqj.ZorbaXQItemType.getNodeName(), org.zorbaxquery.api.xqj.ZorbaXQItemType.getPIName(), org.zorbaxquery.api.xqj.ZorbaXQItemType.getSchemaURI(), and org.zorbaxquery.api.xqj.ZorbaXQItemType.getTypeName().

boolean org.zorbaxquery.api.xqj.ZorbaXQItemType.isAnonymousType ( )
inline

Represents whether the item type is an anonymous type in the schema.

Returns
true if the item type is an anonymous type in the schema, false otherwise.

Definition at line 680 of file ZorbaXQItemType.java.

Referenced by org.zorbaxquery.api.xqj.ZorbaXQItemType.equals().

boolean org.zorbaxquery.api.xqj.ZorbaXQItemType.isElementNillable ( )
inline

Returns whether the element type is nillable or not.

Returns
true if the element type is nillable, false otherwise.

Definition at line 689 of file ZorbaXQItemType.java.

Referenced by org.zorbaxquery.api.xqj.ZorbaXQItemType.equals().

String org.zorbaxquery.api.xqj.ZorbaXQItemType.toString ( )
inline

Returns a human-readable implementation-defined string representation of the item type.

Returns
String a string representation of the item type

Definition at line 830 of file ZorbaXQItemType.java.

Member Data Documentation

final int org.zorbaxquery.api.xqj.ZorbaXQItemType.ZORBA_XQITEMKIND_ANY = 0
static
final int org.zorbaxquery.api.xqj.ZorbaXQItemType.ZORBA_XQITEMKIND_ATTRIBUTE = 3
static
final int org.zorbaxquery.api.xqj.ZorbaXQItemType.ZORBA_XQITEMKIND_COMMENT = 6
static
final int org.zorbaxquery.api.xqj.ZorbaXQItemType.ZORBA_XQITEMKIND_DOCUMENT = 1
static
final int org.zorbaxquery.api.xqj.ZorbaXQItemType.ZORBA_XQITEMKIND_ELEMENT = 2
static
final int org.zorbaxquery.api.xqj.ZorbaXQItemType.ZORBA_XQITEMKIND_PI = 5
static
final int org.zorbaxquery.api.xqj.ZorbaXQItemType.ZORBA_XQITEMKIND_TEXT = 4
static

The documentation for this class was generated from the following file:
blog comments powered by Disqus