public class AnyExternalObjectType extends java.lang.Object implements ItemType
ItemType.WithSequenceTypeCache
Modifier and Type | Field and Description |
---|---|
static AnyExternalObjectType |
THE_INSTANCE |
Modifier | Constructor and Description |
---|---|
protected |
AnyExternalObjectType() |
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
|
java.lang.String |
getAlphaCode()
Get an alphabetic code representing the type, or at any rate, the nearest built-in type
from which this type is derived.
|
AtomicType |
getAtomizedItemType()
Get the item type of the atomic values that will be produced when an item
of this type is atomized
|
Genre |
getGenre()
Determine the Genre (top-level classification) of this type
|
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 . |
boolean |
isAtomicType()
Determine whether this item type is an atomic type
|
boolean |
isAtomizable(TypeHierarchy th)
Ask whether values of this type are atomizable
|
boolean |
isPlainType()
Determine whether this item type is a plain type (that is, whether it can ONLY match
atomic values)
|
boolean |
matches(Item item,
TypeHierarchy th)
Test whether a given item conforms to this type
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
explainMismatch, isTrueItemType, toExportString, toString
public static AnyExternalObjectType THE_INSTANCE
public boolean isAtomicType()
ItemType
isAtomicType
in interface ItemType
public boolean matches(Item item, TypeHierarchy th) throws XPathException
ItemType
matches
in interface ItemType
item
- The item to be testedth
- The type hierarchy cache. Currently used only when matching function items.XPathException
public boolean isPlainType()
ItemType
isPlainType
in interface ItemType
public int getPrimitiveType()
ItemType
getPrimitiveType
in interface ItemType
public java.lang.String getAlphaCode()
getAlphaCode
in interface ItemType
public java.lang.String generateJavaScriptItemTypeTest(ItemType knownToBe, int targetVersion) throws XPathException
ItemType
generateJavaScriptItemTypeTest
in interface ItemType
knownToBe
- An item type that the supplied item is known to conform to; the generated code
can assume that the item is an instance of this type.targetVersion
- The version of Saxon-JS for which code is being generated. Currently either 1 or 2.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
ItemType
generateJavaScriptItemTypeAcceptor
in interface ItemType
errorCode
- the error to be thrown if conversion is not possibletargetVersion
- the version of Saxon-JS for which code is being generatedXPathException
public ItemType getPrimitiveItemType()
ItemType
getPrimitiveItemType
in interface ItemType
public UType getUType()
ItemType
UType
. A UType is a union of primitive item
types.public AtomicType getAtomizedItemType()
ItemType
getAtomizedItemType
in interface ItemType
public boolean isAtomizable(TypeHierarchy th)
ItemType
isAtomizable
in interface ItemType
th
- the type hierarchy cacheCopyright (c) 2004-2020 Saxonica Limited. All rights reserved.