|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectnet.sf.saxon.expr.ComputedExpression
net.sf.saxon.expr.FunctionCall
net.sf.saxon.expr.FunctionProxy
public class FunctionProxy
This class acts as a proxy for an extension function defined as a method in a user-defined class
Field Summary |
---|
Fields inherited from class net.sf.saxon.expr.FunctionCall |
---|
argument |
Fields inherited from class net.sf.saxon.expr.ComputedExpression |
---|
lineNumber, NO_ARGUMENTS, staticProperties |
Constructor Summary | |
---|---|
FunctionProxy()
Constructor: creates an uncommitted FunctionProxy |
Method Summary | |
---|---|
Expression |
analyze(StaticContext env)
Type-check the function call. |
void |
checkArguments(StaticContext env)
Method called by the expression parser when all arguments have been supplied |
int |
computeCardinality()
Determine the cardinality of the result. |
static Value |
convertJavaObjectToXPath(Object result,
Controller controller)
Convert a Java object to an XPath value. |
Item |
evaluateItem(XPathContext context)
Evaluate the function. |
AccessibleObject |
getBestFit(Value[] argValues)
Get the best fit amongst all the candidate methods, constructors, or fields |
static Class |
getImplicitJavaClass(String uri)
Extract a class name from the URI |
int |
getIntrinsicDependencies()
Determine which aspects of the context the expression depends on. |
ItemType |
getItemType()
Determine the data type of the expression, if possible |
String |
getName()
Get the name of the function |
static Class |
getVendorExtensionClass(String uri)
Get a class corresponding to a known extension function URI |
SequenceIterator |
iterate(XPathContext context)
Return an Iterator to iterate over the values of a sequence. |
Expression |
preEvaluate(StaticContext env)
preEvaluate: this method suppresses compile-time evaluation by doing nothing (because the external function might have side-effects and might use the context) |
void |
setDebug(boolean b)
Set debug flag. |
boolean |
setFunctionName(Class reqClass,
String localName,
int numArgs)
setFunctionName: locates the external class and the method (or candidate methods) to which this function relates. |
Methods inherited from class net.sf.saxon.expr.FunctionCall |
---|
checkArgumentCount, display, getNumberOfArguments, getSubExpressions, promote, setArguments, simplify, simplifyArguments |
Methods inherited from class net.sf.saxon.expr.ComputedExpression |
---|
computeDependencies, computeSpecialProperties, computeStaticProperties, dynamicError, effectiveBooleanValue, evaluateAsString, getCardinality, getDependencies, getLineNumber, getSpecialProperties, markTailFunctionCalls, setLineNumber, typeError |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public FunctionProxy()
Method Detail |
---|
public void setDebug(boolean b)
public boolean setFunctionName(Class reqClass, String localName, int numArgs)
The method is also used while calling function-available(). In this case the number of arguments is not known (it will be set to zero). We return true if a match was found, regardless of the number of arguments.
reqClass
- The Java class namelocalName
- The local name used in the XPath function callnumArgs
- The number of arguments in the function call. -1 indicates unknown;
this is used during a call on function-available() with no second argument
public Expression preEvaluate(StaticContext env)
preEvaluate
in class FunctionCall
public void checkArguments(StaticContext env) throws XPathException
checkArguments
in class FunctionCall
XPathException
public ItemType getItemType()
public int computeCardinality()
computeCardinality
in class ComputedExpression
public String getName()
getName
in class FunctionCall
public Expression analyze(StaticContext env) throws XPathException
analyze
in interface Expression
analyze
in class FunctionCall
env
- the static context of the expression
XPathException
- if an error is discovered during this phase
(typically a type error)public int getIntrinsicDependencies()
getIntrinsicDependencies
in class ComputedExpression
public AccessibleObject getBestFit(Value[] argValues) throws XPathException
XPathException
public Item evaluateItem(XPathContext context) throws XPathException
evaluateItem
in interface Expression
evaluateItem
in class ComputedExpression
context
- The context in which the function is to be evaluated
XPathException
- if the function cannot be evaluated.public SequenceIterator iterate(XPathContext context) throws XPathException
ComputedExpression
iterate
in interface Expression
iterate
in class ComputedExpression
context
- supplies the context for evaluation
XPathException
- if any dynamic error occurs evaluating the
expressionpublic static Class getVendorExtensionClass(String uri)
public static Class getImplicitJavaClass(String uri)
public static Value convertJavaObjectToXPath(Object result, Controller controller) throws XPathException
result
- The Java object to be convertedcontroller
- The controller: may be null, in which case a Source object cannot be
supplied
XPathException
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |