Interface CodeInjector

All Known Implementing Classes:
TimingCodeInjector, TraceCodeInjector, 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 Details

    • inject

      Expression inject(Expression exp, StaticContext env, int construct, StructuredQName qName)
      Wrap an expression in a diagnostic expression.
      Parameters:
      exp - the expression to be wrapped
      env - the static context
      construct - integer constant identifying the kind of construct
      qName - the name of the construct (if applicable)
      Returns:
      a replacement for the original expression (or the original expression unchanged). Normally the new expression will collect or output some diagnostic information and then invoke the original expression. However this is not required; the new expression could be a complete replacement for the original.
    • injectClause

      Clause injectClause(Clause target, StaticContext env)
      Insert a tracing clause into the pipeline of clauses that evaluates a FLWOR expression
      Parameters:
      target - the clause whose execution is being traced
      env - the static context of the containing FLWOR expression