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 Link icon

    Modifier and Type
    Method
    Description
    default Expression
    Process an expression.
    default Clause
    injectClause(FLWORExpression expression, Clause clause)
    Insert a tracing or monitoring clause into the pipeline of clauses that evaluates a FLWOR expression
    default void
    Process a component such as a function, template, or global variable.
  • Method Details Link icon

    • inject Link icon

      default Expression inject(Expression exp)
      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.
    • process Link icon

      default void process(TraceableComponent component)
      Process a component such as a function, template, or global variable. The default implementation does nothing.
      Parameters:
      component - the component to be processed
    • injectClause Link icon

      default Clause injectClause(FLWORExpression expression, Clause clause)
      Insert a tracing or monitoring clause into the pipeline of clauses that evaluates a FLWOR expression
      Parameters:
      expression - the containing FLWOR expression
      clause - the clause whose execution is being monitored
      Returns:
      an injected clause; or the original. The default implementation returns the original clause unchanged.