Package com.oracle.coherence.common.base
Class StackTrace
java.lang.Object
com.oracle.coherence.common.base.StackTrace
Class for providing StackTrace functionality.
- Since:
- 20.06
- Author:
- cp 2000.08.02
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classA class that provides "stack frame" information from a line of a stack trace. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic BigDecimalensureBigDecimal(Number num) Ensure the specified Number is a BigDecimal value or convert it into a new BigDecimal object.static StackTrace.StackFrameGet the StackFrame information for the caller of the current method.static StringgetDeepMessage(Throwable t, String sDelim) Extract a throwable's message, and all causal messages.static StringgetExpression(String sMethod) Get the source code expression from the method that called the specified method.static StackTrace.StackFrameGet the StackFrame information for the current method.static StackTrace.StackFrame[]Iterate the StackFrame information for all callers, going from the inside outwards, and starting with the caller of this method.static StringBuild a stack trace for the current thread.static StringPrint stack trace for running thread.static StringBuild a stack trace for the passed exception that does not include the exception description itself.static StringBuild a stack trace for the passed exception.
-
Constructor Details
-
StackTrace
public StackTrace()
-
-
Method Details
-
getCallerStackFrame
Get the StackFrame information for the caller of the current method.- Returns:
- the StackFrame information for the caller of the current method
-
getStackFrame
Get the StackFrame information for the current method.- Returns:
- the StackFrame information for the current method
-
getStackFrames
Iterate the StackFrame information for all callers, going from the inside outwards, and starting with the caller of this method.- Returns:
- an Iterator of StackFrames
-
getStackTrace
Build a stack trace for the current thread.- Returns:
- a String containing a printable stack trace
-
getStackTrace
Build a stack trace for the passed exception that does not include the exception description itself.- Parameters:
e- a Throwable object that contains stack trace information- Returns:
- a String containing a printable stack trace
-
getDeepMessage
Extract a throwable's message, and all causal messages.- Parameters:
t- the throwablesDelim- the delimiter to include between messages- Returns:
- the concatenated messages
-
printStackTrace
Build a stack trace for the passed exception.- Parameters:
e- a Throwable object that contains stack trace information- Returns:
- a String containing a printable stack trace
-
ensureBigDecimal
Ensure the specified Number is a BigDecimal value or convert it into a new BigDecimal object.- Parameters:
num- a Number object- Returns:
- a BigDecimal object that is equal to the passed in Number
-
getExpression
Get the source code expression from the method that called the specified method.- Parameters:
sMethod- the first method on the stack after the method whose source code is desired- Returns:
- null on any failure, otherwise the expression
-
getStackTrace
Print stack trace for running thread.- Parameters:
t- thread- Returns:
- thread stack trace or empty string if thread is not running
-