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
Modifier and TypeClassDescriptionstatic class
A class that provides "stack frame" information from a line of a stack trace. -
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic BigDecimal
ensureBigDecimal
(Number num) Ensure the specified Number is a BigDecimal value or convert it into a new BigDecimal object.static StackTrace.StackFrame
Get the StackFrame information for the caller of the current method.static String
getDeepMessage
(Throwable t, String sDelim) Extract a throwable's message, and all causal messages.static String
getExpression
(String sMethod) Get the source code expression from the method that called the specified method.static StackTrace.StackFrame
Get 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 String
Build a stack trace for the current thread.static String
Print stack trace for running thread.static String
Build a stack trace for the passed exception that does not include the exception description itself.static String
Build 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
-