|
||||||||||
PREV CLASS (src) NEXT CLASS (src) | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.jboss.util.StackTrace
Provides access to the current stack trace by parsing the output of
Throwable.printStackTrace()
.
Nested Class Summary | |
static class |
StackTrace.Entry (src)
A stack trace entry. |
static class |
StackTrace.Parser (src)
A parser which takes a standard Throwable and produces StackTrace.Entry (src) objects. |
Field Summary | |
protected java.util.List |
stack
List of StackTrace.Entry elements |
static int |
UNLIMITED
Parse all entries |
Constructor Summary | |
|
StackTrace()
Construct a StackTrace. |
|
StackTrace(int level)
Construct a StackTrace. |
|
StackTrace(int level,
int limit)
Construct a StackTrace. |
protected |
StackTrace(java.util.List stack)
Sub-trace constructor. |
|
StackTrace(java.lang.Throwable detail)
Initialize a StackTrace. |
|
StackTrace(java.lang.Throwable detail,
int level)
Initialize a StackTrace. |
|
StackTrace(java.lang.Throwable detail,
int level,
int limit)
Initialize a StackTrace. |
Method Summary | |
static StackTrace.Entry (src) |
callerEntry()
Returns a stack trace entry for the calling methods current position in the stack. |
java.lang.Object |
clone()
Returns a shallow cloned copy of this object. |
static StackTrace.Entry (src) |
currentEntry()
Returns a stack trace entry for the current position in the stack. |
boolean |
equals(java.lang.Object obj)
Check if the given object is equals to this. |
StackTrace.Entry (src) |
getCallerEntry()
Returns the stack trace entry for the calling method. |
StackTrace (src) |
getCallerTrace()
Returns the stack trace starting at the calling method. |
StackTrace.Entry (src) |
getEntry(int level)
Returns the stack trace entry for the element at the given level. |
StackTrace.Entry (src) |
getRootEntry()
Return the root entry for this stack trace. |
StackTrace (src) |
getSubTrace(int level)
Returns a sub trace starting at the the given level. |
StackTrace (src) |
getSubTrace(int level,
int limit)
Returns a sub trace starting at the the given level. |
java.util.Iterator |
iterator()
Returns an iterator over all of the entries in the stack trace. |
void |
print()
Print this stack trace to System.err . |
void |
print(java.io.PrintStream stream)
Print this stack trace. |
void |
print(java.io.PrintStream stream,
java.lang.String prefix)
Print this stack trace. |
void |
print(java.io.PrintWriter writer)
Print this stack trace. |
void |
print(java.io.PrintWriter writer,
java.lang.String prefix)
Print this stack trace. |
void |
print(java.lang.String prefix)
Print this stack trace to System.err . |
static StackTrace.Entry (src) |
rootEntry()
Returns a stack trace entry for the root calling method of the current execution thread. |
int |
size()
Returns the number of entries (or size) of the stack trace. |
Methods inherited from class java.lang.Object |
finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
public static final int UNLIMITED
protected final java.util.List stack
Constructor Detail |
public StackTrace(java.lang.Throwable detail, int level, int limit)
detail
- Detail throwable to determine stack entries from.level
- Number of levels to go down into the trace.limit
- The maximum number of entries to parse (does not
include skipped levels or the description).
A value <= zero results in all entries being parsed.
java.lang.IllegalArgumentException
- Invalid level or limit.
NestedRuntimeException (src)
- Failed to create Parser.
NestedRuntimeException (src)
- Failed to parse stack trace.public StackTrace(java.lang.Throwable detail, int level)
detail
- Detail throwable to determine stack entries from.level
- Number of levels to go down into the trace.
java.lang.IllegalArgumentException
- Invalid level.
NestedRuntimeException (src)
- Failed to create Parser.
NestedRuntimeException (src)
- Failed to parse stack trace.public StackTrace(java.lang.Throwable detail)
detail
- Detail throwable to determine stack entries from.
NestedRuntimeException (src)
- Failed to create Parser.
NestedRuntimeException (src)
- Failed to parse stack trace.public StackTrace(int level, int limit)
level
- Number of levels to go down into the trace.limit
- The maximum number of entries to parse (does not
include skipped levels or the description).
A value <= zero results in all entries being parsed.public StackTrace(int level)
level
- Number of levels to go down into the trace.public StackTrace()
protected StackTrace(java.util.List stack)
Method Detail |
public boolean equals(java.lang.Object obj)
obj
- Object to test equality with.
public java.lang.Object clone()
public StackTrace.Entry (src) getEntry(int level)
level
- Number of levels.
java.lang.IndexOutOfBoundsException
- Invalid level index.public StackTrace.Entry (src) getCallerEntry()
public StackTrace.Entry (src) getRootEntry()
public StackTrace (src) getSubTrace(int level)
level
- Number of levels.
public StackTrace (src) getSubTrace(int level, int limit)
level
- Number of levels.limit
- Limit the sub-trace. If there are less entries
than the limit, the limit has no effect.
public StackTrace (src) getCallerTrace()
public void print(java.io.PrintWriter writer, java.lang.String prefix)
print
in interface Printable (src)
writer
- The writer to print to.prefix
- Stack trace entry prefix.public void print(java.io.PrintWriter writer)
print
in interface Printable (src)
writer
- The writer to print to.public void print(java.io.PrintStream stream, java.lang.String prefix)
print
in interface Printable (src)
stream
- The stream to print to.prefix
- Stack trace entry prefix.public void print(java.io.PrintStream stream)
print
in interface Printable (src)
stream
- The stream to print to.public void print(java.lang.String prefix)
System.err
.
prefix
- Stack trace entry prefix.public void print()
System.err
.
public java.util.Iterator iterator()
public int size()
public static final StackTrace.Entry (src) currentEntry()
The current entry refers to the method that has invoked
currentEntry()
.
public static final StackTrace.Entry (src) callerEntry()
Calling method in this case refers to the method that has called
the method which invoked callerEntry()
.
java.lang.IndexOutOfBoundsException
- The current entry is at bottom
of the stack.public static final StackTrace.Entry (src) rootEntry()
|
||||||||||
PREV CLASS (src) NEXT CLASS (src) | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |