private void notifyListener(String label, Value val, XPathContext context) { InstructionDetails info = (InstructionDetails)getInstructionInfo(); info.setConstructType(Location.TRACE_CALL); info.setNamespaceResolver(resolver); info.setProperty("label", label); info.setProperty("value", val); TraceListener listener = context.getController().getTraceListener(); listener.enter(info, context); listener.leave(info); }
private void notifyListener(String label, Value val, XPathContext context) { InstructionDetails info = (InstructionDetails)getInstructionInfo(); info.setConstructType(Location.TRACE_CALL); info.setNamespaceResolver(resolver); info.setProperty("label", label); info.setProperty("value", val); TraceListener listener = context.getController().getTraceListener(); listener.enter(info, context); listener.leave(info); }
/** * Execute this instruction, with the possibility of returning tail calls if there are any. * This outputs the trace information via the registered TraceListener, * and invokes the instruction being traced. * @param context the dynamic execution context * @return either null, or a tail call that the caller must invoke on return * @throws net.sf.saxon.trans.XPathException */ public TailCall processLeavingTail(XPathContext context) throws XPathException { Controller controller = context.getController(); TraceListener listener = controller.getTraceListener(); if (controller.isTracing()) { listener.enter(getInstructionInfo(), context); } // Don't attempt tail call optimization when tracing, the results are too confusing child.process(context); if (controller.isTracing()) { listener.leave(getInstructionInfo()); } return null; }
private void notifyListener(String label, Value val, XPathContext context) { InstructionDetails info = new InstructionDetails(); info.setConstructType(Location.TRACE_CALL); info.setLineNumber(getLineNumber()); info.setSystemId(getSystemId()); info.setProperty("label", label); info.setProperty("value", val); TraceListener listener = context.getController().getTraceListener(); listener.enter(info, context); listener.leave(info); }
/** * Execute this instruction, with the possibility of returning tail calls if there are any. * This outputs the trace information via the registered TraceListener, * and invokes the instruction being traced. * @param context the dynamic execution context * @return either null, or a tail call that the caller must invoke on return * @throws net.sf.saxon.trans.XPathException */ public TailCall processLeavingTail(XPathContext context) throws XPathException { Controller controller = context.getController(); TraceListener listener = controller.getTraceListener(); if (controller.isTracing()) { listener.enter(getInstructionInfo(), context); } // Don't attempt tail call optimization when tracing, the results are too confusing child.process(context); if (controller.isTracing()) { listener.leave(getInstructionInfo()); } return null; }
/** * Return an Iterator to iterate over the values of a sequence. The value of every * expression can be regarded as a sequence, so this method is supported for all * expressions. This default implementation handles iteration for expressions that * return singleton values: for non-singleton expressions, the subclass must * provide its own implementation. * * @exception net.sf.saxon.trans.XPathException if any dynamic error occurs evaluating the * expression * @param context supplies the context for evaluation * @return a SequenceIterator that can be used to iterate over the result * of the expression */ public SequenceIterator iterate(XPathContext context) throws XPathException { Controller controller = context.getController(); if (controller.isTracing()) { controller.getTraceListener().enter(getInstructionInfo(), context); } SequenceIterator result = child.iterate(context); if (controller.isTracing()) { controller.getTraceListener().leave(getInstructionInfo()); } return result; }
/** * Return an Iterator to iterate over the values of a sequence. The value of every * expression can be regarded as a sequence, so this method is supported for all * expressions. This default implementation handles iteration for expressions that * return singleton values: for non-singleton expressions, the subclass must * provide its own implementation. * * @exception net.sf.saxon.trans.XPathException if any dynamic error occurs evaluating the * expression * @param context supplies the context for evaluation * @return a SequenceIterator that can be used to iterate over the result * of the expression */ public SequenceIterator iterate(XPathContext context) throws XPathException { Controller controller = context.getController(); if (controller.isTracing()) { controller.getTraceListener().enter(getInstructionInfo(), context); } SequenceIterator result = child.iterate(context); if (controller.isTracing()) { controller.getTraceListener().leave(getInstructionInfo()); } return result; }
/** * Evaluate an expression as a single item. This always returns either a single Item or * null (denoting the empty sequence). No conversion is done. This method should not be * used unless the static type of the expression is a subtype of "item" or "item?": that is, * it should not be called if the expression may return a sequence. There is no guarantee that * this condition will be detected. * * @param context The context in which the expression is to be evaluated * @exception net.sf.saxon.trans.XPathException if any dynamic error occurs evaluating the * expression * @return the node or atomic value that results from evaluating the * expression; or null to indicate that the result is an empty * sequence */ public Item evaluateItem(XPathContext context) throws XPathException { Controller controller = context.getController(); if (controller.isTracing()) { controller.getTraceListener().enter(getInstructionInfo(), context); } Item result = child.evaluateItem(context); if (controller.isTracing()) { controller.getTraceListener().leave(getInstructionInfo()); } return result; }
/** * Evaluate an expression as a single item. This always returns either a single Item or * null (denoting the empty sequence). No conversion is done. This method should not be * used unless the static type of the expression is a subtype of "item" or "item?": that is, * it should not be called if the expression may return a sequence. There is no guarantee that * this condition will be detected. * * @param context The context in which the expression is to be evaluated * @exception net.sf.saxon.trans.XPathException if any dynamic error occurs evaluating the * expression * @return the node or atomic value that results from evaluating the * expression; or null to indicate that the result is an empty * sequence */ public Item evaluateItem(XPathContext context) throws XPathException { Controller controller = context.getController(); if (controller.isTracing()) { controller.getTraceListener().enter(getInstructionInfo(), context); } Item result = child.evaluateItem(context); if (controller.isTracing()) { controller.getTraceListener().leave(getInstructionInfo()); } return result; }