Package net.sf.saxon.expr
Class UnionCastableFunction
- java.lang.Object
-
- net.sf.saxon.functions.AbstractFunction
-
- net.sf.saxon.expr.UnionConstructorFunction
-
- net.sf.saxon.expr.UnionCastableFunction
-
- All Implemented Interfaces:
Callable
,Function
,GroundedValue
,Item
,Sequence
public class UnionCastableFunction extends UnionConstructorFunction
Function to test castability to a union type
-
-
Field Summary
-
Fields inherited from class net.sf.saxon.expr.UnionConstructorFunction
allowEmpty, resolver, targetType
-
-
Constructor Summary
Constructors Constructor Description UnionCastableFunction(UnionType targetType, NamespaceResolver resolver, boolean allowEmpty)
Create a cast expression to a union type
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description BooleanValue
call(XPathContext context, Sequence[] args)
Invoke the functionFunctionItemType
getFunctionItemType()
Get the item type of the function itemStructuredQName
getFunctionName()
Get the name of the function, or null if it is anonymous-
Methods inherited from class net.sf.saxon.expr.UnionConstructorFunction
cast, cast, getArity, getDescription, getNamespaceResolver, getOperandRole, getTargetType, isAllowEmpty
-
Methods inherited from class net.sf.saxon.functions.AbstractFunction
atomize, deepEquals, effectiveBooleanValue, export, getAnnotations, getOperandRoles, getStringValue, getStringValueCS, isArray, isMap, isTrustedResultType, makeNewContext, simplify, typeCheck
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface net.sf.saxon.om.Function
getGenre, toShortString
-
Methods inherited from interface net.sf.saxon.om.GroundedValue
asIterable, concatenate, containsNode, materialize
-
Methods inherited from interface net.sf.saxon.om.Item
getLength, head, isStreamed, itemAt, iterate, reduce, subsequence
-
Methods inherited from interface net.sf.saxon.om.Sequence
makeRepeatable
-
-
-
-
Constructor Detail
-
UnionCastableFunction
public UnionCastableFunction(UnionType targetType, NamespaceResolver resolver, boolean allowEmpty)
Create a cast expression to a union type- Parameters:
targetType
- the union type that is the result of the castresolver
- namespace resolver in case the type is namespace-sensitiveallowEmpty
- true if an empty sequence may be supplied as input, converting to an empty sequence on output
-
-
Method Detail
-
getFunctionItemType
public FunctionItemType getFunctionItemType()
Get the item type of the function item- Specified by:
getFunctionItemType
in interfaceFunction
- Overrides:
getFunctionItemType
in classUnionConstructorFunction
- Returns:
- the function item's type
-
getFunctionName
public StructuredQName getFunctionName()
Get the name of the function, or null if it is anonymous- Specified by:
getFunctionName
in interfaceFunction
- Overrides:
getFunctionName
in classUnionConstructorFunction
- Returns:
- the function name, or null for an anonymous function
-
call
public BooleanValue call(XPathContext context, Sequence[] args) throws XPathException
Invoke the function- Specified by:
call
in interfaceCallable
- Specified by:
call
in interfaceFunction
- Overrides:
call
in classUnionConstructorFunction
- Parameters:
context
- the XPath dynamic evaluation contextargs
- the actual arguments to be supplied- Returns:
- the result of invoking the function
- Throws:
XPathException
- if a dynamic error occurs within the function
-
-