Package net.sf.saxon.trace
Class TraceCodeInjector
java.lang.Object
net.sf.saxon.trace.TraceCodeInjector
- All Implemented Interfaces:
CodeInjector
- Direct Known Subclasses:
TimingCodeInjector
,XQueryTraceCodeInjector
,XSLTTraceCodeInjector
A code injector that wraps every expression (other than a literal) in a TraceExpression, which causes
a TraceListener to be notified when the expression is evaluated
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptioninject
(Expression exp) Process an expression.injectClause
(FLWORExpression expression, Clause clause) Insert a tracing or monitoring clause into the pipeline of clauses that evaluates a FLWOR expressionprotected boolean
isApplicable
(Expression exp) static int
levelValue
(String level) void
process
(TraceableComponent component) Process a component such as a function, template, or global variable.void
setTraceLevel
(int traceLevel)
-
Field Details
-
traceLevel
protected int traceLevel
-
-
Constructor Details
-
TraceCodeInjector
public TraceCodeInjector()
-
-
Method Details
-
setTraceLevel
public void setTraceLevel(int traceLevel) -
levelValue
-
inject
Description copied from interface:CodeInjector
Process an expression.- Specified by:
inject
in interfaceCodeInjector
- 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.
-
isApplicable
-
process
Description copied from interface:CodeInjector
Process a component such as a function, template, or global variable. The default implementation does nothing.- Specified by:
process
in interfaceCodeInjector
- Parameters:
component
- the component to be processed
-
injectClause
Insert a tracing or monitoring clause into the pipeline of clauses that evaluates a FLWOR expression- Specified by:
injectClause
in interfaceCodeInjector
- 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.
-