Class EvlContext

    • Field Detail

      • optimizeConstraintTrace

        protected boolean optimizeConstraintTrace
      • shortCircuiting

        protected boolean shortCircuiting
      • terminate

        protected boolean terminate
    • Constructor Detail

      • EvlContext

        public EvlContext()
      • EvlContext

        public EvlContext​(IEvlContext other)
        Copy constructor, intended for internal use only.
        Parameters:
        other - The parent context.
        Since:
        1.6
    • Method Detail

      • getConstraintTrace

        public ConstraintTrace getConstraintTrace()
        Description copied from interface: IEvlContext
        Used internally to determine evaluated constraints.
        Specified by:
        getConstraintTrace in interface IEvlContext
        Returns:
        The checked Constraint-element pairs, or null if the trace is disabled.
      • getUnsatisfiedConstraints

        public java.util.Collection<UnsatisfiedConstraint> getUnsatisfiedConstraints()
        Description copied from interface: IEvlContext
        This collection is written to internally by the engine during execution. Although IEvlModule.execute() mandates the results to be a Set, for performance optimisation reasons this method is permitted to return any collection, so long as once execution is complete, the results contain no duplicates. This collection should therefore only be used to add elements, and is expected not to be queried during execution.
        Specified by:
        getUnsatisfiedConstraints in interface IEvlContext
        Returns:
        A mutable collection of unsatisfied Constraint-element pairs.
      • isOptimizeConstraintTrace

        public boolean isOptimizeConstraintTrace()
        Description copied from interface: IEvlContext
        Return true if the constraint results cache is optimized. When optimized, constraint results will only be cached during satisfies operation executions, that is, results will only be cached if required. If false, constraint results will always be cached.

        The default value is false;

        Specified by:
        isOptimizeConstraintTrace in interface IEvlContext
        Returns:
        The value of the flag.
      • isShortCircuiting

        public boolean isShortCircuiting()
        Description copied from interface: IEvlContext
        Option allowing validation to terminate early when any invariant is unsatisfied.
        Specified by:
        isShortCircuiting in interface IEvlContext
        Returns:
        Whether validation will stop once an UnsatisfiedConstraint is found.
      • setShortCircuit

        public void setShortCircuit​(boolean shortCircuit)
        Description copied from interface: IEvlContext
        Sets whether short-circuited validation is enabled.
        Specified by:
        setShortCircuit in interface IEvlContext
        Parameters:
        shortCircuit - The new value for the flag.
      • shouldShortCircuit

        public boolean shouldShortCircuit​(Constraint constraint)
                                   throws EolRuntimeException
        Description copied from interface: IEvlContext
        Checks whether the condition for short-circuiting is met, either by previous invocation returning true or if there are unsatisfied constraints and the IEvlContext.isShortCircuiting() flag is enabled, or if the specified module element has been annotated with a termination criteria and an unsatisfied constraint containing the type is already present.
        Specified by:
        shouldShortCircuit in interface IEvlContext
        Returns:
        Whether termination should be suspended.
        Throws:
        EolRuntimeException