org.unitils.mock.core.proxy
Class StackTraceUtils

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

public class StackTraceUtils
extends Object

Class offering utilities involving the call stack

Author:
Filip Neven, Tim Ducheyne

Constructor Summary
StackTraceUtils()
           
 
Method Summary
static int getInvocationLineNr(Class<?> invokedClass)
           
static StackTraceElement[] getInvocationStackTrace(Class<?> invokedInterface)
           
static StackTraceElement[] getInvocationStackTrace(Class<?> invokedInterface, boolean included)
           
static StackTraceElement[] getStackTraceStartingFrom(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(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 StackTraceElement[] getInvocationStackTrace(Class<?> invokedInterface)
Parameters:
invokedInterface - Class/interface to which an invocation can be found in the current call stack
Returns:
Stack trace 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 StackTraceElement[] getInvocationStackTrace(Class<?> invokedInterface,
                                                          boolean included)

getStackTraceStartingFrom

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


Copyright © 2011. All Rights Reserved.