com.novell.xsl.debug
Class Trace

java.lang.Object
  extended bycom.novell.xsl.debug.Trace

public final class Trace
extends Object

A class that supports tracing of the XSL processor's operation.


Field Summary
static boolean ENABLED
          Flag that enables or disables tracing.
static int TRACE_OFF
          Trace level 0.
static int TRACE_RULE_INSTANTIATIONS
          Trace level 2.
static int TRACE_RULE_MATCHING
          Trace level 4.
static int TRACE_SOURCE_PROCESSING
          Trace level 1.
static int TRACE_TEMPLATE_INSTANTIATIONS
          Trace level 3.
 
Method Summary
static int getTraceLevel()
          Returns the current trace level.
static void setPrintWriter(PrintWriter printWriter)
          Sets the PrintWriter to which trace information is written.
static void setTraceLevel(int traceLevel)
          Sets the trace level; throws an exception if a PrintWriter is not set.
static void traceMatch(String msg)
          Prints part of a trace message giving details about rule matching.
static void traceRuleBegin(Rule rule)
          Prints the beginning of a trace message indicating that the specified rule is about to be instantiated.
static void traceRuleBuiltIn(Rule rule)
          Prints a trace message indicating that the specified built-in rule is about to be instantiated.
static void traceRuleEnd(Rule rule)
          Prints the end of a trace message indicating that the specified rule is about to be instantiated.
static void traceSelect(Expression expr, ExpressionValue result)
          Prints a trace message giving details about a select expression
static void traceSortKey(String msg)
          Prints a trace message giving details about a sort key evaluation
static void traceSource(Node node, Mode mode)
          Prints a trace message indicating that the specified source node is about to be processed in the specified mode.
static void traceTemplate(String msg)
          Prints a trace message indicating that a template is about to be instantiated.
static void traceTemplate(String msg, Mode mode)
          Prints a trace message indicating that a template is about to be instantiated in the specified mode.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

ENABLED

public static final boolean ENABLED
Flag that enables or disables tracing. When this flag is false, most compilers' optimizers, including javac -O, should be able to eliminate any runtime cost. Note that this is a compile-time setting versus the trace level which is a runtime setting.

See Also:
Constant Field Values

TRACE_OFF

public static final int TRACE_OFF
Trace level 0.

See Also:
Constant Field Values

TRACE_SOURCE_PROCESSING

public static final int TRACE_SOURCE_PROCESSING
Trace level 1.

See Also:
Constant Field Values

TRACE_RULE_INSTANTIATIONS

public static final int TRACE_RULE_INSTANTIATIONS
Trace level 2.

See Also:
Constant Field Values

TRACE_TEMPLATE_INSTANTIATIONS

public static final int TRACE_TEMPLATE_INSTANTIATIONS
Trace level 3.

See Also:
Constant Field Values

TRACE_RULE_MATCHING

public static final int TRACE_RULE_MATCHING
Trace level 4.

See Also:
Constant Field Values
Method Detail

setPrintWriter

public static void setPrintWriter(PrintWriter printWriter)
Sets the PrintWriter to which trace information is written.

Parameters:
printWriter - the PrintWriter to which trace information is written
See Also:
setTraceLevel(int)

getTraceLevel

public static int getTraceLevel()
Returns the current trace level.

Returns:
the current trace level
See Also:
setTraceLevel(int)

setTraceLevel

public static void setTraceLevel(int traceLevel)
Sets the trace level; throws an exception if a PrintWriter is not set. The default trace level is TRACE_OFF.

Parameters:
traceLevel - the level of detail to trace; one of the TRACE_ constants
Throws:
IllegalArgumentException - if traceLevel is out of range
IllegalStateException - if a PrintWriter is not set
See Also:
setPrintWriter(java.io.PrintWriter)

traceSource

public static void traceSource(Node node,
                               Mode mode)
Prints a trace message indicating that the specified source node is about to be processed in the specified mode.

Parameters:
node - the source node that is about to be processed
mode - the mode in which the node is about to be processed

traceRuleBegin

public static void traceRuleBegin(Rule rule)
Prints the beginning of a trace message indicating that the specified rule is about to be instantiated.

Parameters:
rule - the rule that is about to be instantiated

traceRuleEnd

public static void traceRuleEnd(Rule rule)
Prints the end of a trace message indicating that the specified rule is about to be instantiated.

Parameters:
rule - the rule that is about to be instantiated

traceRuleBuiltIn

public static void traceRuleBuiltIn(Rule rule)
Prints a trace message indicating that the specified built-in rule is about to be instantiated.

Parameters:
rule - the built-in rule that is about to be instantiated; null means there is no applicable built-in rule

traceTemplate

public static void traceTemplate(String msg)
Prints a trace message indicating that a template is about to be instantiated.

Parameters:
msg - a description of the template that is about to be instantiated

traceTemplate

public static void traceTemplate(String msg,
                                 Mode mode)
Prints a trace message indicating that a template is about to be instantiated in the specified mode.

Parameters:
msg - a description of the template that is about to be instantiated
mode - the mode in which the template is about to be instantiated

traceMatch

public static void traceMatch(String msg)
Prints part of a trace message giving details about rule matching.

Parameters:
msg - the string to be printed

traceSelect

public static void traceSelect(Expression expr,
                               ExpressionValue result)
Prints a trace message giving details about a select expression

Parameters:
expr - The expression that was evaluated
result - The result of the expression evaluation

traceSortKey

public static void traceSortKey(String msg)
Prints a trace message giving details about a sort key evaluation

Parameters:
msg - Message giving details about the key