public class AnyItemType extends java.lang.Object implements ItemType.WithSequenceTypeCache
ItemType.WithSequenceTypeCache
Modifier and Type | Method and Description |
---|---|
java.lang.String |
generateJavaScriptItemTypeAcceptor(java.lang.String errorCode,
int targetVersion)
Generate Javascript code to convert a supplied Javascript value to this item type,
if conversion is possible, or throw an error otherwise.
|
java.lang.String |
generateJavaScriptItemTypeTest(ItemType knownToBe,
int targetVersion)
Generate Javascript code to test whether an item conforms to this item type
|
AtomicType |
getAtomizedItemType()
Get the item type of the atomic values that will be produced when an item
of this type is atomized
|
double |
getDefaultPriority() |
static AnyItemType |
getInstance()
Factory method to get the singleton instance
|
ItemType |
getPrimitiveItemType()
Get the primitive item type corresponding to this item type.
|
int |
getPrimitiveType()
Get the primitive type corresponding to this item type.
|
UType |
getUType()
Get the corresponding
UType . |
int |
hashCode()
Returns a hash code value for the object.
|
boolean |
isAtomicType()
Determine whether this item type is an atomic type
|
boolean |
isAtomizable()
Ask whether values of this type are atomizable
|
boolean |
isPlainType()
Determine whether this item type is atomic (that is, whether it can ONLY match
atomic values)
|
boolean |
matches(Item item,
TypeHierarchy th)
Test whether a given item conforms to this type
|
SequenceType |
one()
Get a sequence type representing exactly one instance of this atomic type
|
SequenceType |
oneOrMore()
Get a sequence type representing one or more instances of this atomic type
|
java.lang.String |
toExportString()
Return a string representation of this SequenceType suitable for use in export (SEF) files.
|
java.lang.String |
toString() |
void |
visitNamedSchemaComponents(SchemaComponentVisitor visitor)
Visit all the schema components used in this ItemType definition
|
SequenceType |
zeroOrMore()
Get a sequence type representing one or more instances of this atomic type
|
SequenceType |
zeroOrOne()
Get a sequence type representing zero or one instances of this atomic type
|
public static AnyItemType getInstance()
public UType getUType()
UType
. A UType is a union of primitive item
types.public boolean isAtomicType()
isAtomicType
in interface ItemType
public boolean isPlainType()
isPlainType
in interface ItemType
public boolean matches(Item item, TypeHierarchy th)
public ItemType getPrimitiveItemType()
getPrimitiveItemType
in interface ItemType
public int getPrimitiveType()
ItemType
getPrimitiveType
in interface ItemType
public AtomicType getAtomizedItemType()
ItemType
getAtomizedItemType
in interface ItemType
public boolean isAtomizable()
isAtomizable
in interface ItemType
public void visitNamedSchemaComponents(SchemaComponentVisitor visitor) throws XPathException
visitNamedSchemaComponents
in interface ItemType
visitor
- the visitor class to be called when each component is visitedXPathException
- if an error occurspublic double getDefaultPriority()
public java.lang.String toString()
public java.lang.String toExportString()
toExportString
in interface ItemType
public int hashCode()
hashCode
in class java.lang.Object
public java.lang.String generateJavaScriptItemTypeTest(ItemType knownToBe, int targetVersion) throws XPathException
generateJavaScriptItemTypeTest
in interface ItemType
knownToBe
- targetVersion
- XPathException
- if JS code cannot be generated for this item type, for example because
the test is schema-aware.public java.lang.String generateJavaScriptItemTypeAcceptor(java.lang.String errorCode, int targetVersion) throws XPathException
generateJavaScriptItemTypeAcceptor
in interface ItemType
errorCode
- the error to be thrown if conversion is not possibletargetVersion
- XPathException
public SequenceType one()
one
in interface ItemType.WithSequenceTypeCache
public SequenceType zeroOrOne()
zeroOrOne
in interface ItemType.WithSequenceTypeCache
public SequenceType oneOrMore()
oneOrMore
in interface ItemType.WithSequenceTypeCache
public SequenceType zeroOrMore()
zeroOrMore
in interface ItemType.WithSequenceTypeCache
Copyright (c) 2004-2018 Saxonica Limited. All rights reserved.