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; }
/** * Copy an expression. This makes a deep copy. * * @param rebindings variable bindings that need to be changed * @return the copy of the original expression */ /*@NotNull*/ public Expression copy(RebindingMap rebindings) { if (function == null) { // not bound yet, we have no way to register the new copy with the XSLFunction throw new UnsupportedOperationException("UserFunctionCall.copy()"); } UserFunctionCall ufc = new UserFunctionCall(); ufc.setFunction(function); ufc.setStaticType(staticType); int numArgs = getArity(); Expression[] a2 = new Expression[numArgs]; for (int i = 0; i < numArgs; i++) { a2[i] = getArg(i).copy(rebindings); } ufc.setArguments(a2); ExpressionTool.copyLocationInfo(this, ufc); return ufc; }
/** * Copy an expression. This makes a deep copy. * * @param rebindings variable bindings that need to be changed * @return the copy of the original expression */ /*@NotNull*/ public Expression copy(RebindingMap rebindings) { if (function == null) { // not bound yet, we have no way to register the new copy with the XSLFunction throw new UnsupportedOperationException("UserFunctionCall.copy()"); } UserFunctionCall ufc = new UserFunctionCall(); ufc.setFunction(function); ufc.setStaticType(staticType); int numArgs = getArity(); Expression[] a2 = new Expression[numArgs]; for (int i = 0; i < numArgs; i++) { a2[i] = getArg(i).copy(rebindings); } ufc.setArguments(a2); ExpressionTool.copyLocationInfo(this, ufc); return ufc; }