org.eclipse.ocl.examples.debug.vm.utils
Class Trace

java.lang.Object
  extended by org.eclipse.ocl.examples.debug.vm.utils.Trace

public class Trace
extends java.lang.Object


Field Summary
protected  java.lang.String exceptionsCatchingOption
           
protected  java.lang.String exceptionsThrowingOption
           
protected static java.lang.String LABEL_NEW_VALUE
          Label indicating new value.
protected static java.lang.String LABEL_OLD_VALUE
          Label indicating old value.
protected  java.lang.String methodsEnteringOption
           
protected  java.lang.String methodsExitingOption
           
protected static java.lang.String PARENTHESIS_CLOSE
          String containing a close parenthesis.
protected static java.lang.String PARENTHESIS_OPEN
          String containing an open parenthesis.
protected static java.lang.String PREFIX_CATCHING
          Prefix for tracing the catching of throwables.
protected static java.lang.String PREFIX_CHANGING
          Prefix for tracing the changing of values.
protected static java.lang.String PREFIX_ENTERING
          Prefix for tracing the entering of methods.
protected static java.lang.String PREFIX_EXITING
          Prefix for tracing the exiting of methods.
protected static java.lang.String PREFIX_THROWING
          Prefix for tracing the throwing of throwables.
protected static java.lang.String SEPARATOR_METHOD
          Separator for methods.
protected static java.lang.String SEPARATOR_PARAMETER
          Separator for parameters.
protected static java.lang.String SEPARATOR_RETURN
          Separator for return values.
protected static java.lang.String SEPARATOR_SPACE
          Separator containing a space.
 
Constructor Summary
Trace(java.lang.String exceptionsCatchingOption, java.lang.String exceptionsThrowingOption, java.lang.String methodsEnteringOption, java.lang.String methodsExitingOption)
           
 
Method Summary
 void catching(java.lang.Class<?> clazz, java.lang.String methodName, java.lang.Throwable throwable)
          Traces the catching of the specified throwable in the specified method of the specified class.
 void entering(java.lang.Class<?> clazz, java.lang.String methodName)
          Traces an entry into the specified method of the specified class.
 void entering(java.lang.Class<?> clazz, java.lang.String methodName, java.lang.Object parameter)
          Traces an entry into the specified method of the specified class, with the specified parameter.
 void entering(java.lang.Class<?> clazz, java.lang.String methodName, java.lang.Object[] parameters)
          Traces an entry into the specified method of the specified class, with the specified parameters.
 void entering(java.lang.String option, java.lang.Class<?> clazz, java.lang.String methodName)
          Traces an entry into the specified method of the specified class.
 void entering(java.lang.String option, java.lang.Class<?> clazz, java.lang.String methodName, java.lang.Object parameter)
          Traces an entry into the specified method of the specified class, with the specified parameter.
 void entering(java.lang.String option, java.lang.Class<?> clazz, java.lang.String methodName, java.lang.Object[] parameters)
          Traces an entry into the specified method of the specified class, with the specified parameters.
 void exiting(java.lang.Class<?> clazz, java.lang.String methodName)
          Traces an exit from the specified method of the specified class.
 void exiting(java.lang.Class<?> clazz, java.lang.String methodName, java.lang.Object returnValue)
          Traces an exit from the specified method of the specified class, with the specified return value.
 void exiting(java.lang.String option, java.lang.Class<?> clazz, java.lang.String methodName)
          Traces an exit from the specified method of the specified class.
 void exiting(java.lang.String option, java.lang.Class<?> clazz, java.lang.String methodName, java.lang.Object returnValue)
          Traces an exit from the specified method of the specified class, with the specified return value.
 boolean shouldTrace(java.lang.String option)
          Queries whether tracing is enabled for the specified debug option of this plug-in.
 boolean shouldTraceCatching()
          Queries whether exception catch tracing is enabled.
 boolean shouldTraceEntering()
          Queries whether method entry tracing is enabled.
 boolean shouldTraceEntering(java.lang.String option)
          Queries whether method entry tracing is enabled for the specified debug option.
 boolean shouldTraceExiting()
          Queries whether method exit tracing is enabled.
 boolean shouldTraceExiting(java.lang.String option)
          Queries whether method exit tracing is enabled for the specified debug option.
 boolean shouldTraceThrowing()
          Queries whether exception throw tracing is enabled.
protected  void start(org.eclipse.core.runtime.Plugin plugin)
           
protected  void stop()
           
 void throwing(java.lang.Class<?> clazz, java.lang.String methodName, java.lang.Throwable throwable)
          Traces the throwing of the specified throwable from the specified method of the specified class.
static java.lang.String toString(java.lang.Object[] array)
          Converts an array of objects to a string for trace output.
 void trace(java.lang.String message)
          Traces the specified message from this plug-in.
 void trace(java.lang.String option, java.lang.String message)
          Traces the specified message from this plug-in for the specified debug option.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

PARENTHESIS_OPEN

protected static final java.lang.String PARENTHESIS_OPEN
String containing an open parenthesis.

See Also:
Constant Field Values

PARENTHESIS_CLOSE

protected static final java.lang.String PARENTHESIS_CLOSE
String containing a close parenthesis.

See Also:
Constant Field Values

PREFIX_CHANGING

protected static final java.lang.String PREFIX_CHANGING
Prefix for tracing the changing of values.

See Also:
Constant Field Values

PREFIX_CATCHING

protected static final java.lang.String PREFIX_CATCHING
Prefix for tracing the catching of throwables.

See Also:
Constant Field Values

PREFIX_THROWING

protected static final java.lang.String PREFIX_THROWING
Prefix for tracing the throwing of throwables.

See Also:
Constant Field Values

PREFIX_ENTERING

protected static final java.lang.String PREFIX_ENTERING
Prefix for tracing the entering of methods.

See Also:
Constant Field Values

PREFIX_EXITING

protected static final java.lang.String PREFIX_EXITING
Prefix for tracing the exiting of methods.

See Also:
Constant Field Values

SEPARATOR_METHOD

protected static final java.lang.String SEPARATOR_METHOD
Separator for methods.

See Also:
Constant Field Values

SEPARATOR_PARAMETER

protected static final java.lang.String SEPARATOR_PARAMETER
Separator for parameters.

See Also:
Constant Field Values

SEPARATOR_RETURN

protected static final java.lang.String SEPARATOR_RETURN
Separator for return values.

See Also:
Constant Field Values

SEPARATOR_SPACE

protected static final java.lang.String SEPARATOR_SPACE
Separator containing a space.

See Also:
Constant Field Values

LABEL_OLD_VALUE

protected static final java.lang.String LABEL_OLD_VALUE
Label indicating old value.

See Also:
Constant Field Values

LABEL_NEW_VALUE

protected static final java.lang.String LABEL_NEW_VALUE
Label indicating new value.

See Also:
Constant Field Values

exceptionsCatchingOption

@NonNull
protected final java.lang.String exceptionsCatchingOption

exceptionsThrowingOption

@NonNull
protected final java.lang.String exceptionsThrowingOption

methodsEnteringOption

@NonNull
protected final java.lang.String methodsEnteringOption

methodsExitingOption

@NonNull
protected final java.lang.String methodsExitingOption
Constructor Detail

Trace

public Trace(@NonNull
             java.lang.String exceptionsCatchingOption,
             @NonNull
             java.lang.String exceptionsThrowingOption,
             @NonNull
             java.lang.String methodsEnteringOption,
             @NonNull
             java.lang.String methodsExitingOption)
Method Detail

start

protected void start(org.eclipse.core.runtime.Plugin plugin)

stop

protected void stop()

shouldTraceEntering

public boolean shouldTraceEntering()
Queries whether method entry tracing is enabled.

Returns:
whether method entry tracing is enabled

shouldTraceEntering

public boolean shouldTraceEntering(java.lang.String option)
Queries whether method entry tracing is enabled for the specified debug option.

Parameters:
option - the debug option to test
Returns:
whether method entry tracing is enabled for the option

shouldTraceExiting

public boolean shouldTraceExiting()
Queries whether method exit tracing is enabled.

Returns:
whether method exit tracing is enabled

shouldTraceExiting

public boolean shouldTraceExiting(java.lang.String option)
Queries whether method exit tracing is enabled for the specified debug option.

Parameters:
option - the debug option to test
Returns:
whether method exit tracing is enabled for the option

shouldTraceCatching

public boolean shouldTraceCatching()
Queries whether exception catch tracing is enabled.

Returns:
whether exception catch tracing is enabled

shouldTraceThrowing

public boolean shouldTraceThrowing()
Queries whether exception throw tracing is enabled.

Returns:
whether exception throw tracing is enabled

shouldTrace

public boolean shouldTrace(java.lang.String option)
Queries whether tracing is enabled for the specified debug option of this plug-in.

Parameters:
option - The debug option for which to determine trace enablement.
Returns:
Whether tracing is enabled for the debug option of the plug-in.

trace

public void trace(java.lang.String message)
Traces the specified message from this plug-in.

Parameters:
message - The message to be traced.

trace

public void trace(java.lang.String option,
                  java.lang.String message)
Traces the specified message from this plug-in for the specified debug option.

Parameters:
option - The debug option for which to trace.
message - The message to be traced.

entering

public void entering(java.lang.Class<?> clazz,
                     java.lang.String methodName)
Traces an entry into the specified method of the specified class.

Parameters:
clazz - The class whose method is being entered.
methodName - The name of method that is being entered.

entering

public void entering(java.lang.Class<?> clazz,
                     java.lang.String methodName,
                     java.lang.Object parameter)
Traces an entry into the specified method of the specified class, with the specified parameter.

Parameters:
clazz - The class whose method is being entered.
methodName - The name of method that is being entered.
parameter - The parameter to the method being entered.

entering

public void entering(java.lang.Class<?> clazz,
                     java.lang.String methodName,
                     java.lang.Object[] parameters)
Traces an entry into the specified method of the specified class, with the specified parameters.

Parameters:
clazz - The class whose method is being entered.
methodName - The name of method that is being entered.
parameters - The parameters to the method being entered.

entering

public void entering(java.lang.String option,
                     java.lang.Class<?> clazz,
                     java.lang.String methodName)
Traces an entry into the specified method of the specified class.

Parameters:
option - only trace entering if this option is enabled (in addition to the generic method-entry option)
clazz - The class whose method is being entered.
methodName - The name of method that is being entered.

entering

public void entering(java.lang.String option,
                     java.lang.Class<?> clazz,
                     java.lang.String methodName,
                     java.lang.Object parameter)
Traces an entry into the specified method of the specified class, with the specified parameter.

Parameters:
option - only trace entering if this option is enabled (in addition to the generic method-entry option)
clazz - The class whose method is being entered.
methodName - The name of method that is being entered.
parameter - The parameter to the method being entered.

entering

public void entering(java.lang.String option,
                     java.lang.Class<?> clazz,
                     java.lang.String methodName,
                     java.lang.Object[] parameters)
Traces an entry into the specified method of the specified class, with the specified parameters.

Parameters:
option - only trace entering if this option is enabled (in addition to the generic method-entry option)
clazz - The class whose method is being entered.
methodName - The name of method that is being entered.
parameters - The parameters to the method being entered.

exiting

public void exiting(java.lang.Class<?> clazz,
                    java.lang.String methodName)
Traces an exit from the specified method of the specified class.

Parameters:
clazz - The class whose method is being exited.
methodName - The name of method that is being exited.

exiting

public void exiting(java.lang.Class<?> clazz,
                    java.lang.String methodName,
                    java.lang.Object returnValue)
Traces an exit from the specified method of the specified class, with the specified return value.

Parameters:
clazz - The class whose method is being exited.
methodName - The name of method that is being exited.
returnValue - The return value of the method being exited.

exiting

public void exiting(java.lang.String option,
                    java.lang.Class<?> clazz,
                    java.lang.String methodName)
Traces an exit from the specified method of the specified class.

Parameters:
option - only trace entering if this option is enabled (in addition to the generic method-exit option)
clazz - The class whose method is being exited.
methodName - The name of method that is being exited.

exiting

public void exiting(java.lang.String option,
                    java.lang.Class<?> clazz,
                    java.lang.String methodName,
                    java.lang.Object returnValue)
Traces an exit from the specified method of the specified class, with the specified return value.

Parameters:
option - only trace entering if this option is enabled (in addition to the generic method-exit option)
clazz - The class whose method is being exited.
methodName - The name of method that is being exited.
returnValue - The return value of the method being exited.

catching

public void catching(java.lang.Class<?> clazz,
                     java.lang.String methodName,
                     java.lang.Throwable throwable)
Traces the catching of the specified throwable in the specified method of the specified class.

Parameters:
clazz - The class in which the throwable is being caught.
methodName - The name of the method in which the throwable is being caught.
throwable - The throwable that is being caught.

throwing

public void throwing(java.lang.Class<?> clazz,
                     java.lang.String methodName,
                     java.lang.Throwable throwable)
Traces the throwing of the specified throwable from the specified method of the specified class.

Parameters:
clazz - The class from which the throwable is being thrown.
methodName - The name of the method from which the throwable is being thrown.
throwable - The throwable that is being thrown.

toString

public static java.lang.String toString(java.lang.Object[] array)
Converts an array of objects to a string for trace output.

Parameters:
array - the array to convert to a string
Returns:
the string