Class UnknownContext

  • All Implemented Interfaces:
    IContext

    public class UnknownContext
    extends java.lang.Object
    implements IContext
    The fallback IContext.
    • Field Detail

      • RESTRICTIVE

        public static final IContext RESTRICTIVE
        The IContext that forbids all events.
      • PERMISSIVE

        public static final IContext PERMISSIVE
        The IContext that allows all events.
      • allowEvents

        private final boolean allowEvents
    • Constructor Detail

      • UnknownContext

        public UnknownContext​(boolean allowEvents)
        Creates a fallback IContext.
        Parameters:
        allowEvents - defines whether the context allows all events or not
    • Method Detail

      • isAllowed

        public boolean isAllowed​(AbstractContextBasedITextEvent event)
        Depending on its internal state allows or rejects all event. Behaviour is defined via constructor UnknownContext(boolean)
        Specified by:
        isAllowed in interface IContext
        Parameters:
        event - is an event to test
        Returns:
        true if event is allowed by the actual context and false otherwise