Package net.sf.saxon.expr.parser
Interface CodeInjector
- All Known Implementing Classes:
TimingCodeInjector,TraceCodeInjector,XQueryTraceCodeInjector,XSLTTraceCodeInjector
public interface CodeInjector
A code injector can be used to add code to the expression tree (for example, diagnostic tracing code)
during the process of parsing and tree construction
-
Method Summary
Modifier and TypeMethodDescriptiondefault Expressioninject(Expression exp) Process an expression.default ClauseinjectClause(FLWORExpression expression, Clause clause) Insert a tracing or monitoring clause into the pipeline of clauses that evaluates a FLWOR expressiondefault ExpressionProcess an expression as soon as it has been parsed.default voidprocess(TraceableComponent component) Process a component such as a function, template, or global variable.
-
Method Details
-
inject
Process an expression.- Parameters:
exp- the expression to be processed- Returns:
- a new expression. Possibly the original expression unchanged; possibly a wrapper
expression (such as a
TraceExpression; possibly a modified version of the original expression. The default implementation returns the supplied expression unchanged.
-
injectDuringParsing
Process an expression as soon as it has been parsed. Whereas the#inject method is executed in a post-processing pass of the expression tree, this method is called immediately during parsing, and thus has a chance to change the expression before type-checking and optimization kick in. Used by the test driver to implement the -unfolded option.- Parameters:
exp- the expression to be processed- Returns:
- a new expression. Possibly the original expression unchanged; possibly a wrapper
expression (such as a
TraceExpression; possibly a replacement for the original expression. The default implementation returns the supplied expression unchanged.
-
process
Process a component such as a function, template, or global variable. The default implementation does nothing.- Parameters:
component- the component to be processed
-
injectClause
Insert a tracing or monitoring clause into the pipeline of clauses that evaluates a FLWOR expression- Parameters:
expression- the containing FLWOR expressionclause- the clause whose execution is being monitored- Returns:
- an injected clause; or the original. The default implementation returns the original clause unchanged.
-