Qizx/Open v0.4p2

net.xfra.qizxopen.xquery
Class ItemType

java.lang.Object
  |
  +--net.xfra.qizxopen.xquery.Type
        |
        +--net.xfra.qizxopen.xquery.ItemType

public class ItemType
extends Type

class ItemType: encompasses AtomicType (anyAtomicType) and NodeType.


Field Summary
 net.xfra.qizxopen.xquery.impl.SequenceType opt
          The empty or length 1 SequenceType associated with this atomic type.
 net.xfra.qizxopen.xquery.impl.SequenceType plus
          The '+' type sequence associated with this atomic type.
 net.xfra.qizxopen.xquery.impl.SequenceType star
          The '*' type sequence associated with this atomic type.
 
Fields inherited from class net.xfra.qizxopen.xquery.Type
ANY, ANY_ATOMIC_TYPE, anyType, ANYURI, ATOM, ATTRIBUTE, BASE64_BINARY, BINARY, BOOLEAN, BYTE, CHAR, COMMENT, DATE, DATE_TIME, DAY_TIME_DURATION, DECIMAL, DOCUMENT, DOUBLE, DURATION, ELEMENT, ENTITY, ERR_EMPTY_UNEXPECTED, ERR_TOO_MANY, ERR_TYPE_MISMATCH, FLOAT, G_DAY, G_MONTH, G_MONTH_DAY, G_YEAR, G_YEAR_MONTH, HEX_BINARY, ID, IDREF, INT, INTEGER, ITEM, LANGUAGE, LONG, MOMENT, MULTI_OCC, NAME, NAMESPACE, NCNAME, NEGATIVE_INTEGER, NMTOKEN, NODE, NON_NEGATIVE_INTEGER, NON_POSITIVE_INTEGER, NONE, NORMALIZED_STRING, NOTATION, NUMERIC, OBJECT, ONE_OCC, OPT_OCC, OPTMULTI_OCC, PI, POSITIVE_INTEGER, QNAME, SHORT, STRING, TEXT, TIME, TOKEN, UNSIGNED_BYTE, UNSIGNED_INT, UNSIGNED_LONG, UNSIGNED_SHORT, UNTYPED_ATOMIC, untypedAtomic, WRAPPED_OBJECT, YEAR_MONTH_DURATION
 
Constructor Summary
ItemType()
           
 
Method Summary
 boolean accepts(Type valueType)
          Static type checking.
 boolean acceptsItem(Item item)
          Dynamic matching of a single item.
 Value cast(Value value, EvalContext context)
          Attempts to cast the current item of the value to this type.
 Value convertFromArray(java.lang.Object object)
          Conversion of external Java array of related type to internal value.
 java.lang.Object convertToArray(Value value)
          Conversion of internal value to external Java array of proper type.
 ItemType getItemType()
          If this is a sequence type, return the item type, otherwise return the type itself.
 java.lang.String getShortName()
           
 ItemType getSuperType()
           
 boolean isDerivedFrom(ItemType root)
          Derived in the sense of XSD hierarchy.
 boolean isSuperType(ItemType subtype)
          SuperType with slight differences wrt XSD: introduces NumericType, MomentType
 
Methods inherited from class net.xfra.qizxopen.xquery.Type
check, convertFromObject, convertToObject, dump, findItemType, getName, getOccurrence, isOptional, isRepeatable, test, toString, toString, unionWith
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

star

public net.xfra.qizxopen.xquery.impl.SequenceType star
The '*' type sequence associated with this atomic type.


plus

public net.xfra.qizxopen.xquery.impl.SequenceType plus
The '+' type sequence associated with this atomic type.


opt

public net.xfra.qizxopen.xquery.impl.SequenceType opt
The empty or length 1 SequenceType associated with this atomic type.

Constructor Detail

ItemType

public ItemType()
Method Detail

accepts

public boolean accepts(Type valueType)
Description copied from class: Type
Static type checking. Tells whether a static expression type can be accepted by this formal type.

Overrides:
accepts in class Type

acceptsItem

public boolean acceptsItem(Item item)
Description copied from class: Type
Dynamic matching of a single item. For optimization of typeswitch.

Overrides:
acceptsItem in class Type

getItemType

public ItemType getItemType()
Description copied from class: Type
If this is a sequence type, return the item type, otherwise return the type itself.

Overrides:
getItemType in class Type

getShortName

public java.lang.String getShortName()
Overrides:
getShortName in class Type

getSuperType

public ItemType getSuperType()

isSuperType

public boolean isSuperType(ItemType subtype)
SuperType with slight differences wrt XSD: introduces NumericType, MomentType


isDerivedFrom

public boolean isDerivedFrom(ItemType root)
Derived in the sense of XSD hierarchy.


cast

public Value cast(Value value,
                  EvalContext context)
           throws TypeException
Attempts to cast the current item of the value to this type.

Returns:
if successful, the converted value as a single item sequence.
Throws:
xquery.TypeException - if the item's type or value is incompatible.
TypeException

convertFromArray

public Value convertFromArray(java.lang.Object object)
Conversion of external Java array of related type to internal value.


convertToArray

public java.lang.Object convertToArray(Value value)
                                throws XQueryException
Conversion of internal value to external Java array of proper type. For example: xs:short produces short[].

XQueryException

 Copyright Xavier FRANC 2003-2004