Class StackTraceScanner

java.lang.Object
clazzfish.monitor.util.StackTraceScanner

public class StackTraceScanner extends Object
This class allows you to scan the stacktrace for different stuff.
Since:
1.4.1 (24.01.2014)
Author:
oliver
  • Method Details

    • getCallerClass

      public static Class<?> getCallerClass()
      Gets the caller class by examing the stacktrace.
      Returns:
      the caller class
    • getCallerClass

      public static Class<?> getCallerClass(Pattern... excluded)
      Gets the caller class by examing the stacktrace.
      Parameters:
      excluded - a list of filters which should be not considered as caller
      Returns:
      the caller of
    • getCallerClass

      public static Class<?> getCallerClass(Pattern[] excludedMethods, Class<?>... excludedClasses)
      Gets the caller class by examing the stacktrace.
      Parameters:
      excludedMethods - the excluded methods
      excludedClasses - the excluded classes
      Returns:
      the caller class
    • getCallerStackTrace

      public static StackTraceElement[] getCallerStackTrace()
      Gets the caller stack trace of the method or constructor which calls it.
      Returns:
      the caller stack trace
      Since:
      1.4.2 (17.05.2014)
    • getCallerStackTrace

      public static StackTraceElement[] getCallerStackTrace(Pattern... excluded)
      Gets the caller stack trace of the method or constructor which calls it.
      Parameters:
      excluded - a list of filters which should be not considered as caller
      Returns:
      the caller stack trace
      Since:
      1.4.2 (17.05.2014)
    • getCallerStackTrace

      public static StackTraceElement[] getCallerStackTrace(Pattern[] excludedMethods, Class<?>... excludedClasses)
      Gets the caller stack trace of the method or constructor which calls it.
      Parameters:
      excludedMethods - the excluded methods
      excludedClasses - the excluded classes
      Returns:
      the caller stack trace
      Since:
      1.4.2 (17.05.2014)