public Sequence<?>[] evaluateArguments(XPathContext c) throws XPathException { return evaluateArguments(c, false); }
public Sequence<?>[] evaluateArguments(XPathContext c) throws XPathException { return evaluateArguments(c, false); }
/** * Evaluate an updating expression, adding the results to a Pending Update List. * The default implementation of this method, which is used for non-updating expressions, * throws an UnsupportedOperationException * * @param context the XPath dynamic evaluation context * @param pul the pending update list to which the results should be written */ public void evaluatePendingUpdates(XPathContext context, PendingUpdateList pul) throws XPathException { ValueRepresentation[] actualArgs = evaluateArguments(context); XPathContextMajor c2 = context.newCleanContext(); c2.setOrigin(this); function.callUpdating(actualArgs, c2, pul); }
/** * Evaluate an updating expression, adding the results to a Pending Update List. * The default implementation of this method, which is used for non-updating expressions, * throws an UnsupportedOperationException * * @param context the XPath dynamic evaluation context * @param pul the pending update list to which the results should be written */ public void evaluatePendingUpdates(XPathContext context, PendingUpdateList pul) throws XPathException { Sequence[] actualArgs = evaluateArguments(context); XPathContextMajor c2 = context.newCleanContext(); c2.setOrigin(this); function.callUpdating(actualArgs, c2, pul); }
/** * Evaluate an updating expression, adding the results to a Pending Update List. * The default implementation of this method, which is used for non-updating expressions, * throws an UnsupportedOperationException * * @param context the XPath dynamic evaluation context * @param pul the pending update list to which the results should be written */ public void evaluatePendingUpdates(XPathContext context, PendingUpdateList pul) throws XPathException { Sequence[] actualArgs = evaluateArguments(context); XPathContextMajor c2 = context.newCleanContext(); c2.setOrigin(this); function.callUpdating(actualArgs, c2, pul); }
/** * Process the function call in push mode * @param context the XPath dynamic context * @throws XPathException */ public void process(XPathContext context) throws XPathException { ValueRepresentation[] actualArgs = evaluateArguments(context); if (tailCall) { ((XPathContextMajor)context).requestTailCall(function, actualArgs); } else { SequenceReceiver out = context.getReceiver(); XPathContextMajor c2 = context.newCleanContext(); c2.setReceiver(out); c2.setOrigin(this); function.process(actualArgs, c2); } }
/** * Process the function call in push mode * @param context the XPath dynamic context * @throws XPathException */ public void process(XPathContext context) throws XPathException { ValueRepresentation[] actualArgs = evaluateArguments(context); if (tailCall) { ((XPathContextMajor)context).requestTailCall(function, actualArgs); } else { SequenceReceiver out = context.getReceiver(); XPathContextMajor c2 = context.newCleanContext(); c2.setReceiver(out); c2.setOrigin(this); function.process(actualArgs, c2); } }
/** * Process the function call in push mode * @param context the XPath dynamic context * @throws XPathException */ public void process(XPathContext context) throws XPathException { ValueRepresentation[] actualArgs = evaluateArguments(context); if (tailCall) { ((XPathContextMajor)context).requestTailCall(function, actualArgs); } else { SequenceReceiver out = context.getReceiver(); XPathContextMajor c2 = context.newCleanContext(); c2.setReceiver(out); c2.setOrigin(this); function.process(actualArgs, c2); } }
/** * Process the function call in pull mode * @param context the XPath dynamic context * @throws XPathException */ public EventIterator iterateEvents(XPathContext context) throws XPathException { ValueRepresentation[] actualArgs = evaluateArguments(context); if (tailCall) { ((XPathContextMajor)context).requestTailCall(function, actualArgs); return EmptyEventIterator.getInstance(); } else { SequenceReceiver out = context.getReceiver(); XPathContextMajor c2 = context.newCleanContext(); c2.setReceiver(out); c2.setOrigin(this); return function.iterateEvents(actualArgs, c2); } }
/** * Process the function call in pull mode * @param context the XPath dynamic context * @throws XPathException */ public EventIterator iterateEvents(XPathContext context) throws XPathException { ValueRepresentation[] actualArgs = evaluateArguments(context); if (tailCall) { ((XPathContextMajor)context).requestTailCall(function, actualArgs); return EmptyEventIterator.getInstance(); } else { SequenceReceiver out = context.getReceiver(); XPathContextMajor c2 = context.newCleanContext(); c2.setReceiver(out); c2.setOrigin(this); return function.iterateEvents(actualArgs, c2); } }
/** * Process the function call in pull mode * @param context the XPath dynamic context * @throws XPathException */ public EventIterator iterateEvents(XPathContext context) throws XPathException { ValueRepresentation[] actualArgs = evaluateArguments(context); if (tailCall) { ((XPathContextMajor)context).requestTailCall(function, actualArgs); return EmptyEventIterator.getInstance(); } else { SequenceReceiver out = context.getReceiver(); XPathContextMajor c2 = context.newCleanContext(); c2.setReceiver(out); c2.setOrigin(this); return function.iterateEvents(actualArgs, c2); } }
/** * This is the method that actually does the function call * @param c the dynamic context * @return the result of the function * @throws XPathException if dynamic errors occur */ private ValueRepresentation callFunction(XPathContext c) throws XPathException { ValueRepresentation[] actualArgs = evaluateArguments(c); if (tailCall) { ((XPathContextMajor)c).requestTailCall(function, actualArgs); return EmptySequence.getInstance(); } XPathContextMajor c2 = c.newCleanContext(); c2.setOrigin(this); c2.setTemporaryOutputState(true); try { return function.call(actualArgs, c2); } catch (StackOverflowError err) { throw new XPathException("Too many nested function calls. May be due to infinite recursion.", this); } catch (NullPointerException err) { if (function == null) { throw new NullPointerException("Unbound function call " + function.getFunctionName().getDisplayName()); } else { throw err; } } }
/** * This is the method that actually does the function call * @param c the dynamic context * @return the result of the function * @throws XPathException if dynamic errors occur */ private ValueRepresentation callFunction(XPathContext c) throws XPathException { ValueRepresentation[] actualArgs = evaluateArguments(c); if (tailCall) { ((XPathContextMajor)c).requestTailCall(function, actualArgs); return EmptySequence.getInstance(); } XPathContextMajor c2 = c.newCleanContext(); c2.setOrigin(this); c2.setTemporaryOutputState(true); try { return function.call(actualArgs, c2); } catch (StackOverflowError err) { throw new XPathException("Too many nested function calls. May be due to infinite recursion.", this); } catch (NullPointerException err) { if (function == null) { throw new NullPointerException("Unbound function call " + function.getFunctionName().getDisplayName()); } else { throw err; } } }
/** * This is the method that actually does the function call * @param c the dynamic context * @return the result of the function * @throws XPathException if dynamic errors occur */ private ValueRepresentation callFunction(XPathContext c) throws XPathException { ValueRepresentation[] actualArgs = evaluateArguments(c); if (tailCall) { ((XPathContextMajor)c).requestTailCall(function, actualArgs); return EmptySequence.getInstance(); } XPathContextMajor c2 = c.newCleanContext(); c2.setOrigin(this); c2.setTemporaryOutputState(true); try { return function.call(actualArgs, c2); } catch (StackOverflowError err) { throw new XPathException("Too many nested function calls. May be due to infinite recursion.", this); } catch (NullPointerException err) { if (function == null) { throw new NullPointerException("Unbound function call " + function.getFunctionName().getDisplayName()); } else { throw err; } } }
/** * Process the function call in push mode * * @param context the XPath dynamic context * @throws XPathException if a dynamic error occurs */ public void process(XPathContext context) throws XPathException { Sequence<?>[] actualArgs = evaluateArguments(context); if (isTailCall()) { requestTailCall(context, actualArgs); return; } if (bindingSlot >= 0) { Component target = getTargetComponent(context); UserFunction targetFunction = (UserFunction) target.getActor(); if (target.getVisibility() == Visibility.ABSTRACT) { throw new XPathException("Cannot call a function defined with visibility=abstract", "XTDE3052"); } XPathContextMajor c2 = targetFunction.makeNewContext(context, this); c2.setCurrentComponent(target); c2.setOrigin(this); targetFunction.process(actualArgs, c2); } else { XPathContextMajor c2 = function.makeNewContext(context, this); c2.setOrigin(this); function.process(actualArgs, c2); } }
/** * Process the function call in push mode * * @param context the XPath dynamic context * @throws XPathException if a dynamic error occurs */ public void process(XPathContext context) throws XPathException { Sequence<?>[] actualArgs = evaluateArguments(context); if (isTailCall()) { requestTailCall(context, actualArgs); return; } if (bindingSlot >= 0) { Component target = getTargetComponent(context); UserFunction targetFunction = (UserFunction) target.getActor(); if (target.getVisibility() == Visibility.ABSTRACT) { throw new XPathException("Cannot call a function defined with visibility=abstract", "XTDE3052"); } XPathContextMajor c2 = targetFunction.makeNewContext(context); c2.setCurrentComponent(target); c2.setOrigin(this); targetFunction.process(actualArgs, c2); } else { XPathContextMajor c2 = function.makeNewContext(context); c2.setOrigin(this); function.process(actualArgs, c2); } }
Sequence<?>[] actualArgs = evaluateArguments(context); XPathContextMajor c2; if (isTailCall()) {
Sequence<?>[] actualArgs = evaluateArguments(context); XPathContextMajor c2; if (isTailCall()) {