|
|||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.saxonica.hof.AbstractFunctionItem com.saxonica.hof.CoercedFunction
public class CoercedFunction
A function item obtained by coercing a supplied function; this adds a wrapper to perform dynamic type checking of the arguments in any call, and type checking of the result.
Field Summary |
---|
Fields inherited from interface net.sf.saxon.om.ValueRepresentation |
---|
EMPTY_VALUE_ARRAY |
Constructor Summary | |
---|---|
CoercedFunction(FunctionItem targetFunction)
Create a CoercedFunction as a wrapper around a target function |
Method Summary | |
---|---|
static CoercedFunction |
coerce(FunctionItem suppliedFunction,
FunctionType requiredType,
RoleLocator role,
ExpressionVisitor visitor)
Factory method to create a CoercedFunction with a given type, for a given targetFunction. |
int |
getArity()
Get the arity of the function |
FunctionItemType |
getFunctionItemType()
Get the item type of the function item |
StructuredQName |
getFunctionName()
Get the name of the function, or null if it is anonymous |
ValueRepresentation |
invoke(ValueRepresentation[] args,
XPathContext context)
Invoke the function |
void |
setArgumentConverter(int arg,
Expression converter)
Set the argument converter for one argument |
void |
setResultConverter(Expression converter)
Set the converter used to process the returned value |
void |
setStackFrameMap(SlotManager stackFrame)
Set the stack frame map identifying the arguments for conversion |
Methods inherited from class com.saxonica.hof.AbstractFunctionItem |
---|
bind, curry, explain, getStringValue, getStringValueCS, getTypedValue, optimize, typeCheck |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public CoercedFunction(FunctionItem targetFunction)
targetFunction
- the function to be wrapped by a type-checking layerMethod Detail |
---|
public void setArgumentConverter(int arg, Expression converter)
arg
- identifies the argument to be convertedconverter
- the expression used to perform the conversionpublic void setResultConverter(Expression converter)
converter
- the expression used to perform the conversionpublic void setStackFrameMap(SlotManager stackFrame)
stackFrame
- public FunctionItemType getFunctionItemType()
public StructuredQName getFunctionName()
public int getArity()
public ValueRepresentation invoke(ValueRepresentation[] args, XPathContext context) throws XPathException
args
- the actual arguments to be suppliedcontext
- the XPath dynamic evaluation context
XPathException
public static CoercedFunction coerce(FunctionItem suppliedFunction, FunctionType requiredType, RoleLocator role, ExpressionVisitor visitor) throws XPathException
XPathException
|
|||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |