AXL Software

com.theorem.misc
Class StackTrace

Object
  extended byStackTrace

public class StackTrace
extends Object

Class to handle stack traces.


Constructor Summary
StackTrace()
           
 
Method Summary
 String getFrom()
          Get the trace information on our caller.
 String getFrom(int back)
          Get the trace information on our caller.
static String getStackTrace()
          Return a stack trace from the current process.
static String getStackTrace(Throwable th)
          Return a stack trace from a Throwable or Exception object.
static boolean isRecursing(String method)
          Check for recursion of the named method.
static void main(String[] a)
           
 String toString()
           
 
Methods inherited from class Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

StackTrace

public StackTrace()
Method Detail

getFrom

public String getFrom()
Get the trace information on our caller.

Returns:
file and line information where getFrom() was called.

getFrom

public String getFrom(int back)
Get the trace information on our caller.

Parameters:
back - Levels back we need to see. Each level corresponds to a method call. For example if getting the value in a debugging method and you need to know where it the original line is from use a 'back' value of 1.
Returns:
file and line information where getFrom() was called.

getStackTrace

public static String getStackTrace()
Return a stack trace from the current process. The stack trace does not include this method but starts at the calling method. This makes the call to getStackTrace() invisible.

Returns:
String containing the stack trace.

getStackTrace

public static String getStackTrace(Throwable th)
Return a stack trace from a Throwable or Exception object.

Parameters:
th - Throwable or Exception.
Returns:
String containing the stack trace.

isRecursing

public static boolean isRecursing(String method)
Check for recursion of the named method.

Parameters:
method - Name of method hopefully including the class name. If the method name is incorrect recursion will never be detected.
Returns:
True if recursion is present.

main

public static final void main(String[] a)

toString

public String toString()

AXL Software

Submit a bug report or feature request

Copyright 1998-2010 AXL Software PO Box 97, Viola, Delaware 19979, U.S.A. All Rights Reserved.