The StackWalker class has four variants of the static factory method, getInstance(), which are different only in their ability to take one of the following several options or no options at all:
- StackWalker getInstance(): This is configured to skip all the hidden frames and no caller class reference.
- StackWalker getInstance(StackWalker.Option option): This creates an instance with the given option, specifying the stack frame information it can access.
- StackWalker getInstance(Set<StackWalker.Option> options): This creates an instance with the given set of options, specifying the stack frame information it can access. If the given set is empty, the instance is configured exactly like an instance of StackWalker getInstance().