public class AnyFunctionType extends java.lang.Object implements FunctionItemType
Note that although this class has a singleton instance representing the type function(*)
,
there are also likely to be instances of subclasses representing more specific function types.
ItemType.WithSequenceTypeCache
Modifier and Type | Field and Description |
---|---|
static AnyFunctionType |
ANY_FUNCTION |
Constructor and Description |
---|
AnyFunctionType() |
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.
|
AnnotationList |
getAnnotationAssertions()
Get the list of annotation assertions defined on this function item type.
|
SequenceType[] |
getArgumentTypes()
Get the argument types of the function
|
PlainType |
getAtomizedItemType()
Get the item type of the atomic values that will be produced when an item
of this type is atomized
|
static AnyFunctionType |
getInstance()
Get the singular instance of this type (Note however that subtypes of this type
may have any number of instances)
|
ItemType |
getPrimitiveItemType()
Get the primitive item type corresponding to this item type.
|
int |
getPrimitiveType()
Get the primitive type corresponding to this item type.
|
SequenceType |
getResultType()
Get the result type
|
UType |
getUType()
Get the corresponding
UType . |
boolean |
isArrayType()
Ask whether this function item type is an array type.
|
boolean |
isAtomicType()
Determine whether this item type is an atomic type
|
boolean |
isAtomizable(TypeHierarchy th)
Ask whether values of this type are atomizable
|
boolean |
isMapType()
Ask whether this function item type is a map type.
|
boolean |
isPlainType()
Determine whether this item type is atomic (that is, whether it can ONLY match
atomic values)
|
Expression |
makeFunctionSequenceCoercer(Expression exp,
RoleDiagnostic role)
Create an expression whose effect is to apply function coercion to coerce a function from this type to another type
|
boolean |
matches(Item item,
TypeHierarchy th)
Test whether a given item conforms to this type
|
int |
relationship(FunctionItemType other,
TypeHierarchy th)
Determine the relationship of one function item type to another
|
java.lang.String |
toString()
Produce a representation of this type name for use in error messages.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
getGenre
explainMismatch, isTrueItemType, toExportString
public static final AnyFunctionType ANY_FUNCTION
public static AnyFunctionType 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 isMapType()
isMapType
in interface FunctionItemType
public boolean isArrayType()
isArrayType
in interface FunctionItemType
public java.lang.String getAlphaCode()
getAlphaCode
in interface ItemType
public SequenceType[] getArgumentTypes()
getArgumentTypes
in interface FunctionItemType
public AnnotationList getAnnotationAssertions()
getAnnotationAssertions
in interface FunctionItemType
public boolean matches(Item item, TypeHierarchy th) throws XPathException
matches
in interface ItemType
item
- The item to be testedth
- XPathException
public final ItemType getPrimitiveItemType()
getPrimitiveItemType
in interface ItemType
public final int getPrimitiveType()
getPrimitiveType
in interface ItemType
public java.lang.String toString()
public PlainType getAtomizedItemType()
getAtomizedItemType
in interface ItemType
public boolean isAtomizable(TypeHierarchy th)
isAtomizable
in interface ItemType
th
- The type hierarchy cachepublic int relationship(FunctionItemType other, TypeHierarchy th)
relationship
in interface FunctionItemType
TypeHierarchy.SUBSUMES
, TypeHierarchy.SAME_TYPE
public Expression makeFunctionSequenceCoercer(Expression exp, RoleDiagnostic role) throws XPathException
makeFunctionSequenceCoercer
in interface FunctionItemType
exp
- the expression that delivers the supplied sequence of function items (the ones in need of coercion)role
- information for use in diagnosticsXPathException
public SequenceType getResultType()
getResultType
in interface FunctionItemType
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
Copyright (c) 2004-2020 Saxonica Limited. All rights reserved.