Class CheckContext


  • public class CheckContext
    extends Object
    Calling context passed to checkers.

    This may be extended for specific needs.

    • Field Detail

      • EMPTY

        public static final CheckContext EMPTY
        The empty check context.
    • Constructor Detail

      • CheckContext

        protected CheckContext()
    • Method Detail

      • getStack

        public List<LocatedObject<?>> getStack()
        Returns:
        The stack of checked located objects.
      • size

        public final int size()
        Returns:
        The stack size.
      • get

        public final <O> LocatedObject<? extends O> get​(Class<O> objectClass,
                                                        int index)
        Returns the located element at an index.
        Type Parameters:
        O - The object type.
        Parameters:
        objectClass - The object class.
        index - The index of the searched element.
        Returns:
        The element at index.
      • push

        public <O> CheckContext push​(LocatedObject<? extends O> element)
        Creates a new context by appending an element to stack.
        Type Parameters:
        O - The object type.
        Parameters:
        element - The element to push.
        Returns:
        A new CheckContext with element pushed at end.