grace.log
Class StackTrace

java.lang.Object
  |
  +--grace.log.StackTrace

public class StackTrace
extends java.lang.Object
implements java.io.Serializable

This class encapsulates the functionality to parse a string containing a stack trace and produce the individual attributes of the stack trace.

See Also:
Serialized Form

Field Summary
static java.lang.String rcsid
           
 
Constructor Summary
StackTrace()
           
StackTrace(java.lang.Exception exception)
           
StackTrace(java.lang.Exception exception, int numLevelsUp)
           
StackTrace(int numLevelsUp)
           
 
Method Summary
static java.lang.String currentStackLine(java.lang.Throwable throwable, int level)
          This returns the a specific line in the given throwable (stack trace) that corresponds to level.
 java.lang.String getClassname()
           
 java.lang.String getFilename()
           
 java.lang.String getFunction()
           
 int getLineNumber()
           
 java.lang.String getLineNumberString()
           
 java.lang.String getShortClassname()
           
protected  void parse(java.lang.String raw)
          Breaks the given line into a class name, line number, function, etc.
 void setClassname(java.lang.String classname)
           
 void setLevel(int numLevelsUp)
          Sets the desired depth of in a stack trace that properly indicates the callers level in the stack trace.
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

rcsid

public static final java.lang.String rcsid
Constructor Detail

StackTrace

public StackTrace()

StackTrace

public StackTrace(int numLevelsUp)

StackTrace

public StackTrace(java.lang.Exception exception)

StackTrace

public StackTrace(java.lang.Exception exception,
                  int numLevelsUp)
Method Detail

currentStackLine

public static java.lang.String currentStackLine(java.lang.Throwable throwable,
                                                int level)
This returns the a specific line in the given throwable (stack trace) that corresponds to level. This raw line can then be parsed to find the position of a caller in the running program.

setLevel

public void setLevel(int numLevelsUp)
Sets the desired depth of in a stack trace that properly indicates the callers level in the stack trace.

setClassname

public void setClassname(java.lang.String classname)

getClassname

public java.lang.String getClassname()

getShortClassname

public java.lang.String getShortClassname()

getFunction

public java.lang.String getFunction()

getFilename

public java.lang.String getFilename()

getLineNumber

public int getLineNumber()

getLineNumberString

public java.lang.String getLineNumberString()

parse

protected void parse(java.lang.String raw)
Breaks the given line into a class name, line number, function, etc. Presumably, the line corresponds to a line from a stack trace.

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object