org.apache.commons.classscan.util
Class CallStack

java.lang.Object
  extended by org.apache.commons.classscan.util.CallStack

public abstract class CallStack
extends Object


Constructor Summary
CallStack()
           
 
Method Summary
static Class<?> getCallerClass(int callStackDepth)
          Return the Class of the caller.
static ClassLoader getClassLoader(int callStackDepth)
          Return the ClassLoader of the caller.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CallStack

public CallStack()
Method Detail

getCallerClass

public static Class<?> getCallerClass(int callStackDepth)
Return the Class of the caller.

Parameters:
callStackDepth - The number of stack frames to skip. A value of 0 will return the calling Class of this method. A value of 1 will return the calling Class of the caller of this method.
Returns:
The Class at callStackDepth down the call stack

getClassLoader

public static ClassLoader getClassLoader(int callStackDepth)
Return the ClassLoader of the caller.

Parameters:
callStackDepth - The number of stack frames to skip. A value of 0 will return the ClassLoader of the calling Class of this method. A value of 1 will return the ClassLoader of the calling Class of the caller of this method.
Returns:
The ClassLoader of the Class at callStackDepth down the call stack


Copyright © 2012 The Apache Software Foundation. All Rights Reserved.