|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||

java.lang.Objectpatterntesting.runtime.util.StackTraceScanner
public final class StackTraceScanner
This class allows you to scan the stacktrace for different stuff.
| Method Summary | |
|---|---|
static StackTraceElement |
find(Class<?> clazz,
Method method)
Find the given method on the stack trace. |
static StackTraceElement |
find(Class<?> clazz,
String methodName)
Find the given method on the stack trace. |
static StackTraceElement |
find(Signature signature)
Find the given signature on the stack trace. |
static StackTraceElement |
find(String classname,
String methodName)
Find the given method on the stack trace. |
static StackTraceElement |
findConstructor(Class<?> clazz)
Find the constructor of the given class on the stack trace. |
static Class<?> |
getCallerClass()
Gets the caller class by examing the stacktrace. |
static Class<?> |
getCallerClass(Pattern... excluded)
Gets the caller class by examing the stacktrace. |
static Class<?> |
getCallerClass(Pattern[] excludedMethods,
Class<?>... excludedClasses)
Gets the caller class by examing the stacktrace. |
static StackTraceElement |
getCallerOf(Class<?> clazz,
Method method)
Gets the caller of the given method. |
static StackTraceElement |
getCallerOf(Class<?> clazz,
Method method,
Pattern... excluded)
Gets the caller of the given method. |
static StackTraceElement |
getCallerOf(Class<?> clazz,
String methodName)
Gets the caller of the given method. |
static StackTraceElement |
getCallerOf(Class<?> clazz,
String methodName,
Pattern... excluded)
Gets the caller of the given method. |
static StackTraceElement |
getCallerOf(Signature signature)
Gets the caller of the given signature. |
static StackTraceElement |
getCallerOf(Signature signature,
Pattern... excluded)
Gets the caller of the given signature. |
static StackTraceElement |
getCallerOf(String classname,
String methodName)
Gets the caller of the given method. |
static StackTraceElement |
getCallerOf(String classname,
String methodName,
Pattern... excluded)
Gets the caller of the given method. |
static StackTraceElement |
getCallerOfConstructor(Class<?> clazz)
Gets the caller of a constructor. |
static StackTraceElement |
getCallerOfConstructor(Class<?> clazz,
Pattern... excluded)
Gets the caller of a constructor. |
static StackTraceElement[] |
getCallerStackTrace()
Gets the caller stack trace of the method or constructor which calls it. |
static StackTraceElement[] |
getCallerStackTrace(Pattern... excluded)
Gets the caller stack trace of the method or constructor which calls it. |
static StackTraceElement[] |
getCallerStackTrace(Pattern[] excludedMethods,
Class<?>... excludedClasses)
Gets the caller stack trace of the method or constructor which calls it. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Method Detail |
|---|
public static StackTraceElement findConstructor(Class<?> clazz)
clazz - the clazz
public static StackTraceElement find(Signature signature)
signature - the signature
public static StackTraceElement find(Class<?> clazz,
Method method)
clazz - the clazzmethod - the method
public static StackTraceElement find(Class<?> clazz,
String methodName)
clazz - the clazzmethodName - the method name
public static StackTraceElement find(String classname,
String methodName)
classname - the classnamemethodName - the method name
public static StackTraceElement getCallerOfConstructor(Class<?> clazz)
clazz - the clazz
public static StackTraceElement getCallerOfConstructor(Class<?> clazz,
Pattern... excluded)
clazz - the clazzexcluded - the excluded
public static StackTraceElement getCallerOf(Signature signature)
signature - the signature
public static StackTraceElement getCallerOf(Class<?> clazz,
Method method)
clazz - the clazzmethod - the method
public static StackTraceElement getCallerOf(Class<?> clazz,
String methodName)
clazz - the clazzmethodName - the method name
public static StackTraceElement getCallerOf(String classname,
String methodName)
classname - the classnamemethodName - the method name
public static StackTraceElement getCallerOf(Signature signature,
Pattern... excluded)
signature - the signatureexcluded - the excluded
public static StackTraceElement getCallerOf(Class<?> clazz,
Method method,
Pattern... excluded)
clazz - the clazzmethod - the methodexcluded - a list of filters which should be not considered as
caller
public static StackTraceElement getCallerOf(Class<?> clazz,
String methodName,
Pattern... excluded)
clazz - the clazzmethodName - the method nameexcluded - a list of filters which should be not considered as
caller
public static StackTraceElement getCallerOf(String classname,
String methodName,
Pattern... excluded)
classname - the classnamemethodName - the method nameexcluded - a list of filters which should be not considered as
caller
public static Class<?> getCallerClass()
public static Class<?> getCallerClass(Pattern... excluded)
excluded - a list of filters which should be not considered as
caller
public static Class<?> getCallerClass(Pattern[] excludedMethods,
Class<?>... excludedClasses)
excludedMethods - the excluded methodsexcludedClasses - the excluded classes
public static StackTraceElement[] getCallerStackTrace()
public static StackTraceElement[] getCallerStackTrace(Pattern... excluded)
excluded - a list of filters which should be not considered as
caller
public static StackTraceElement[] getCallerStackTrace(Pattern[] excludedMethods,
Class<?>... excludedClasses)
excludedMethods - the excluded methodsexcludedClasses - the excluded classes
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||