org.unitils.mock.core.proxy
Class StackTraceUtils

java.lang.Object
  extended by org.unitils.mock.core.proxy.StackTraceUtils

public class StackTraceUtils
extends java.lang.Object

Class offering utilities involving the call stack

Author:
Filip Neven, Tim Ducheyne

Constructor Summary
StackTraceUtils()
           
 
Method Summary
static int getInvocationLineNr(java.lang.Class<?> invokedClass)
           
static java.lang.StackTraceElement[] getInvocationStackTrace(java.lang.Class<?> invokedInterface)
           
static java.lang.StackTraceElement[] getInvocationStackTrace(java.lang.Class<?> invokedInterface, boolean included)
           
static java.lang.StackTraceElement[] getStackTraceStartingFrom(java.lang.StackTraceElement[] stackTraceElements, int index)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

StackTraceUtils

public StackTraceUtils()
Method Detail

getInvocationLineNr

public static int getInvocationLineNr(java.lang.Class<?> invokedClass)
Parameters:
invokedClass - The class for which an invocation can be found in the current call stack
Returns:
the line nr of the invocation in that class, -1 if not found

getInvocationStackTrace

public static java.lang.StackTraceElement[] getInvocationStackTrace(java.lang.Class<?> invokedInterface)
Parameters:
invokedInterface - Class/interface to which an invocation can be found in the current call stack
Returns:
Stacktrace that indicates the most recent method call in the stack that calls a method from the given class, null if not found

getInvocationStackTrace

public static java.lang.StackTraceElement[] getInvocationStackTrace(java.lang.Class<?> invokedInterface,
                                                                    boolean included)

getStackTraceStartingFrom

public static java.lang.StackTraceElement[] getStackTraceStartingFrom(java.lang.StackTraceElement[] stackTraceElements,
                                                                      int index)


Copyright © 2009. All Rights Reserved.