org.ckkloverdos.util
Class CallUtil

java.lang.Object
  extended by org.ckkloverdos.util.CallUtil

public final class CallUtil
extends java.lang.Object

Provides utility methods that reveal information regarding the call stack.

Author:
Christos KK Loverdos

Method Summary
static java.lang.String getCaller3Info()
           
static java.lang.String getCaller3ShortInfo()
           
static java.lang.StackTraceElement getCaller3StackInfo()
           
static java.lang.String getCallerCallerInfo()
          Get information for the method and class calling the caller of the caller of this method.
static java.lang.String getCallerCallerShortInfo()
           
static java.lang.StackTraceElement getCallerCallerStackInfo()
           
static java.lang.String getCallerInfo()
          Get information for the method and class calling the caller of this method.
static java.lang.String getCallerShortInfo()
           
static java.lang.StackTraceElement getCallerStackInfo()
           
static java.lang.String getStackInfo(int depth)
          Returns class and method names information at a specific depth.
static java.lang.String getStackShortInfo(int depth)
           
static java.lang.StackTraceElement[] getStackTrace()
           
static java.lang.StackTraceElement getStackTrace(int depth)
           
static java.lang.String getThisInfo()
          Get information for the method and class calling this method.
static java.lang.String getThisShortInfo()
           
static java.lang.StackTraceElement getThisStackInfo()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getStackInfo

public static java.lang.String getStackInfo(int depth)
Returns class and method names information at a specific depth.

Depth == 0 means the context of the caller of this method, so normally, when issuing UtilLib.getStackInfo(0) from a method foo of class package.SomeClass, a string of the form package.SomeClass::foo will be returned.


getStackTrace

public static java.lang.StackTraceElement[] getStackTrace()

getStackTrace

public static java.lang.StackTraceElement getStackTrace(int depth)

getThisStackInfo

public static java.lang.StackTraceElement getThisStackInfo()

getCallerStackInfo

public static java.lang.StackTraceElement getCallerStackInfo()

getCallerCallerStackInfo

public static java.lang.StackTraceElement getCallerCallerStackInfo()

getCaller3StackInfo

public static java.lang.StackTraceElement getCaller3StackInfo()

getStackShortInfo

public static java.lang.String getStackShortInfo(int depth)

getThisInfo

public static java.lang.String getThisInfo()
Get information for the method and class calling this method.

This is equivalent to calling getStackInfo(1 + 0).


getThisShortInfo

public static java.lang.String getThisShortInfo()

getCallerInfo

public static java.lang.String getCallerInfo()
Get information for the method and class calling the caller of this method.

This is equivalent to calling getStackInfo(1 + 1).


getCallerShortInfo

public static java.lang.String getCallerShortInfo()

getCallerCallerInfo

public static java.lang.String getCallerCallerInfo()
Get information for the method and class calling the caller of the caller of this method.

This is equivalent to calling getStackInfo(1 + 2).


getCallerCallerShortInfo

public static java.lang.String getCallerCallerShortInfo()

getCaller3Info

public static java.lang.String getCaller3Info()

getCaller3ShortInfo

public static java.lang.String getCaller3ShortInfo()


Copyright © 1999-2007 Christos KK Loverdos. All Rights Reserved.