Class StackWalker


  • public final class StackWalker
    extends Object
    A dummy replicate of Java9's StackWalker.
    • Method Detail

      • getInstance

        public static StackWalker getInstance()
        Returns a StackWalker instance with default options.
        Returns:
        a StackWalker configured with the default options
      • getInstance

        public static StackWalker getInstance​(StackWalker.Option option)
        Returns a StackWalker instance with the given option specifying the stack frame information it can access.
        Parameters:
        option - ignored (used by java9 forward)
        Returns:
        a StackWalker configured with the given options
      • getInstance

        public static StackWalker getInstance​(Set<StackWalker.Option> options)
        Returns a StackWalker instance with the given options specifying the stack frame information it can access.
        Parameters:
        options - ignored (used by java9 forward)
        Returns:
        a StackWalker configured with the given options
      • getCallerClass

        public Class<?> getCallerClass()
        Gets the Class object of the caller who invoked the method that invoked getCallerClass.
        Returns:
        Class object of the caller's caller invoking this method.