Interface IEvlContext

    • Field Detail

      • OPTIMIZE_CONSTRAINT_TRACE

        static final java.lang.String OPTIMIZE_CONSTRAINT_TRACE
        Since:
        1.6
        See Also:
        Constant Field Values
    • Method Detail

      • getUnsatisfiedConstraints

        java.util.Collection<UnsatisfiedConstraint> getUnsatisfiedConstraints()
        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.
        Returns:
        A mutable collection of unsatisfied Constraint-element pairs.
      • uniqueUnsatisfiedConstraints

        default java.util.Set<UnsatisfiedConstraint> uniqueUnsatisfiedConstraints()
        This method is called internally once all constraints have been processed to convert the underlying collection in getUnsatisfiedConstraints() to a unique one.
        Returns:
        The final, filtered set of UnsatisfiedConstraints suitable for post-processing.
        Since:
        1.6
      • getConstraintTrace

        ConstraintTrace getConstraintTrace()
        Used internally to determine evaluated constraints.
        Returns:
        The checked Constraint-element pairs, or null if the trace is disabled.
      • isOptimizeConstraintTrace

        boolean isOptimizeConstraintTrace()
        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;

        Returns:
        The value of the flag.
        Since:
        1.6
      • setOptimizeConstraintTrace

        void setOptimizeConstraintTrace​(boolean optimized)
        Set the flag for using optimized contraint result caching.
        Parameters:
        use - Set to true to use optimzied contraint caching.
        Since:
        1.6
        See Also:
        isOptimizeConstraintTrace()
      • isShortCircuiting

        boolean isShortCircuiting()
        Option allowing validation to terminate early when any invariant is unsatisfied.
        Returns:
        Whether validation will stop once an UnsatisfiedConstraint is found.
        Since:
        1.6
      • setShortCircuit

        void setShortCircuit​(boolean shortCircuit)
        Sets whether short-circuited validation is enabled.
        Parameters:
        shortCircuit - The new value for the flag.
        Since:
        1.6
      • shouldShortCircuit

        default boolean shouldShortCircuit​(Constraint constraint)
                                    throws EolRuntimeException
        Checks whether the condition for short-circuiting is met, either by previous invocation returning true or if there are unsatisfied constraints and the 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.
        Parameters:
        Constraint - The rule with the termination annotation.
        Returns:
        Whether termination should be suspended.
        Throws:
        EolRuntimeException
        java.lang.IllegalArgumentException - If the rule parameter is not an appropriate type.
        Since:
        1.6
      • hasFixes

        default boolean hasFixes()
        Returns:
        Since:
        1.6
      • sortUnsatisfiedConstraints

        default java.util.Map<Constraint,​java.util.Set<java.lang.Object>> sortUnsatisfiedConstraints()
        Returns:
        A mapping from a Constraint to all of its unsatisfied instances.
        Since:
        1.6
      • getUnsatisfiedConstraintsBySize

        default java.util.Map<Constraint,​java.lang.Integer> getUnsatisfiedConstraintsBySize()
        Returns:
        A sorted entry of Constraints with the number of unsatisfied instances, in descending order.
        Since:
        1.6
      • getConstraintsDependedOn

        default java.util.Set<Constraint> getConstraintsDependedOn()
        Returns:
        Since:
        1.6