Package net.sf.saxon.type
Interface FunctionItemType
-
- All Superinterfaces:
ItemType
- All Known Subinterfaces:
RecordType
- All Known Implementing Classes:
AnyFunctionType
,AnyFunctionTypeWithAssertions
,ArrayItemType
,MapType
,RecordTest
,SelfReferenceRecordTest
,SpecificFunctionType
public interface FunctionItemType extends ItemType
An ItemType representing the type of a function item (subclasses are used for maps and arrays)
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description AnnotationList
getAnnotationAssertions()
Get the list of Annotation Assertions associated with this function item typeSequenceType[]
getArgumentTypes()
Get the argument types of the functiondefault Genre
getGenre()
Determine the Genre (top-level classification) of this typeSequenceType
getResultType()
Get the result type of the functionboolean
isArrayType()
Ask whether this function item type is an array type.boolean
isMapType()
Ask whether this function item type is a map type.Expression
makeFunctionSequenceCoercer(Expression exp, java.util.function.Supplier<RoleDiagnostic> role, boolean allow40)
Create an expression whose effect is to apply function coercion to coerce a function to this function typeAffinity
relationship(FunctionItemType other, TypeHierarchy th)
Determine the relationship of one function item type to another.-
Methods inherited from interface net.sf.saxon.type.ItemType
explainMismatch, getAtomizedItemType, getBasicAlphaCode, getDefaultPriority, getFullAlphaCode, getNormalizedDefaultPriority, getPrimitiveItemType, getPrimitiveType, getUType, isAtomicType, isAtomizable, isPlainType, matches, toExportString
-
-
-
-
Method Detail
-
getGenre
default Genre getGenre()
Determine the Genre (top-level classification) of this type- Specified by:
getGenre
in interfaceItemType
- Returns:
- the Genre to which this type belongs, specifically
Genre.FUNCTION
-
getArgumentTypes
SequenceType[] getArgumentTypes()
Get the argument types of the function- Returns:
- the argument types, as an array of SequenceTypes; or null if this is the generic function type function(*)
-
getResultType
SequenceType getResultType()
Get the result type of the function- Returns:
- the result type, as a SequenceType
-
relationship
Affinity relationship(FunctionItemType other, TypeHierarchy th)
Determine the relationship of one function item type to another. This method is only concerned with the type signatures of the two function item types, and not with their annotation assertions.- Parameters:
other
- the other function item typeth
- the type hierarchy cache- Returns:
- for example
Affinity.SUBSUMES
,Affinity.SAME_TYPE
-
getAnnotationAssertions
AnnotationList getAnnotationAssertions()
Get the list of Annotation Assertions associated with this function item type- Returns:
- the list of annotation assertions
-
makeFunctionSequenceCoercer
Expression makeFunctionSequenceCoercer(Expression exp, java.util.function.Supplier<RoleDiagnostic> role, boolean allow40) throws XPathException
Create an expression whose effect is to apply function coercion to coerce a function to this function type- Parameters:
exp
- the expression that delivers the supplied sequence of function items (the ones in need of coercion)role
- information for use in diagnosticsallow40
- true if 4.0 coercions are allowed, such as reducing the arity of the function- Returns:
- the coerced function, a function that calls the original function after checking the parameters
- Throws:
XPathException
- if an error is detected
-
isMapType
boolean isMapType()
Ask whether this function item type is a map type. In this case function coercion (to the map type) will never succeed.- Returns:
- true if this FunctionItemType is a map type
-
isArrayType
boolean isArrayType()
Ask whether this function item type is an array type. In this case function coercion (to the array type) will never succeed.- Returns:
- true if this FunctionItemType is an array type
-
-