Package com.adobe.xfa.ut.trace
Class Trace
java.lang.Object
com.adobe.xfa.ut.trace.Trace
This auto registering class is used to define trace areas and issue messages.
The implementer defines an instances of the jfTrace class in the file scope
to ensure all trace areas are available before run-time. These instances then
are registered with the jfTraceHandler during its construction
example:
Trace oDataTrace = new Trace("data", ResId.DataTraceHelp);
Trace oStringTrace new Trace("string" ResId.StringTraceHelp);
main(...)
{
TraceHandler oTraceHandler = new TraceHandler();
TraceHandler.registerTraceHandler(oTraceHandler);
// two ways to activate
oTraceHandler.activate("data", 2);
oStringTrace.activate(3);
...
oTraceHandler.trace(oDataTrace, 2, 27, "data msg"); // issue message
...
oDataTrace.trace(2, 33, "string msg"); // issue message
...
}
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidactivate(int nLevel) Activates this trace section for the current threadvoidDeactivates this trace section for the current threadintgetName()Returns the name of this trace sectionbooleanisEnabled(int nLevel) Check if this trace section is enabled on the current thread.static booleanCheck if this trace section is enabled on the current threadvoidIssues a trace message.voidtrace(int nLevel, MsgFormatPos oMsg) Issues a trace message.static voidIssues a trace message on the current thread.static voidtrace(String sName, int nLevel, MsgFormatPos oMsg) Issues a trace message.
-
Constructor Details
-
Trace
Constructor Registers the trace with a global storage area.- Parameters:
sName- the name of the trace section for which the message will be issuednHelpId- the message Id associated with a one-line help message for this trace section.
-
-
Method Details
-
isEnabled
Check if this trace section is enabled on the current thread- Parameters:
sName- - the name of the trace section for which the message will be issuednLevel- - the detail level of the messages allowed,- Returns:
- true if this trace section is enabled on the current thread, else false
-
trace
Issues a trace message on the current thread.- Parameters:
sName- the name of the trace section for which the message will be issuednLevel- the detail level of the message, 1 for high level information, 3 for detailed information.nId- the message Id.sMsg- the message text.
-
trace
Issues a trace message.- Parameters:
sName- the name of the trace section for which the message will be issuednLevel- the detail level of the message, 1 for high level information, 3 for detailed information.oMsg- the message for the trace.
-
activate
public void activate(int nLevel) Activates this trace section for the current thread- Parameters:
nLevel- the detail level of the messages allowed, 1 for high level information, 3 for detailed information.
-
deactivate
public void deactivate()Deactivates this trace section for the current thread -
getHelpId
public int getHelpId() -
getName
Returns the name of this trace section- Returns:
- the name of this trace section
-
isEnabled
public boolean isEnabled(int nLevel) Check if this trace section is enabled on the current thread.- Parameters:
nLevel- the detail level of the messages allowed,- Returns:
- true if this trace section is enabled on the current thread, else false
-
trace
Issues a trace message.- Parameters:
nLevel- the detail level of the message, 1 for high level information, 3 for detailed information.nId- the message Id.sMsg- the message text.
-
trace
Issues a trace message.- Parameters:
nLevel- the detail level of the message, 1 for high level information, 3 for detailed information.oMsg- the message for the trace.
-