org.unitils.mock.core.proxy
Class StackTraceUtils
java.lang.Object
org.unitils.mock.core.proxy.StackTraceUtils
public class StackTraceUtils
- extends Object
Class offering utilities involving the call stack
- Author:
- Filip Neven, Tim Ducheyne
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
StackTraceUtils
public StackTraceUtils()
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.