StackFrame
In previous sections, we iterated through the StackFrame
elements, and provided sample code snippets, but did not take the time to examine it more closely. StackFrame
is an interface defined inside the StackWalker
class. It defines accessors, and a converter that can be used to convert the information to StackTraceElement
.
The accessors the interface defines are the following:
getClassName()
will return the binary name of the class of the method represented by theStackFrame
.getMethodName()
will return the name of the method represented by theStackFrame
.getDeclaringClass()
will return the class of the method represented by theStackFrame
. If theOption.RETAIN_CLASS_REFERENCE
was not used during the creation of theStackWalker
instance then the method will throwUnsupportedOperationException
.getByteCodeIndex()
gets the index to the code array containing the execution point of the method represented by theStackFrame
. The use of this value can be helpful during bug hunting when looking...