/** * Compute argument evaluation modes for all calls on user defined functions with * a specified expression */ public static void computeEvaluationModesForUserFunctionCalls(Expression exp) throws XPathException { ExpressionTool.processExpressionTree(exp, null, (expression, result) -> { if (expression instanceof UserFunctionCall) { ((UserFunctionCall) expression).allocateArgumentEvaluators(); } if (expression instanceof LocalParam) { ((LocalParam)expression).computeEvaluationMode(); } return false; }); }
/** * Compute argument evaluation modes for all calls on user defined functions with * a specified expression */ public static void computeEvaluationModesForUserFunctionCalls(Expression exp) throws XPathException { ExpressionTool.processExpressionTree(exp, null, (expression, result) -> { if (expression instanceof UserFunctionCall) { ((UserFunctionCall) expression).allocateArgumentEvaluators(); } if (expression instanceof LocalParam) { ((LocalParam)expression).computeEvaluationMode(); } return false; }); }
public Sequence<?>[] evaluateArguments(XPathContext c, boolean streamed) throws XPathException { int numArgs = getArity(); Sequence<?>[] actualArgs = SequenceTool.makeSequenceArray(numArgs); synchronized(this) { if (argumentEvaluators == null) { // should have been done at compile time allocateArgumentEvaluators(); } } for (int i = 0; i < numArgs; i++) { Evaluator eval = argumentEvaluators[i]; if (eval == Evaluator.STREAMING_ARGUMENT && !streamed) { eval = Evaluator.EAGER_SEQUENCE; } actualArgs[i] = eval.evaluate(getArg(i), c); if (actualArgs[i] == null) { actualArgs[i] = EmptySequence.getInstance(); } } return actualArgs; }
public Sequence<?>[] evaluateArguments(XPathContext c, boolean streamed) throws XPathException { int numArgs = getArity(); Sequence<?>[] actualArgs = SequenceTool.makeSequenceArray(numArgs); synchronized(this) { if (argumentEvaluators == null) { // should have been done at compile time allocateArgumentEvaluators(); } } for (int i = 0; i < numArgs; i++) { Evaluator eval = argumentEvaluators[i]; if (eval == Evaluator.STREAMING_ARGUMENT && !streamed) { eval = Evaluator.EAGER_SEQUENCE; } actualArgs[i] = eval.evaluate(getArg(i), c); if (actualArgs[i] == null) { actualArgs[i] = EmptySequence.getInstance(); } } return actualArgs; }
UserFunction fn1 = (UserFunction) target.getActor(); if (fn1 != null) { fc.allocateArgumentEvaluators(); fc.setStaticType(fn1.getResultType()); } else {
UserFunction fn1 = (UserFunction) target.getActor(); if (fn1 != null) { fc.allocateArgumentEvaluators(); fc.setStaticType(fn1.getResultType()); } else {