Interface IEvlContext
- All Superinterfaces:
IEolContext
,IErlContext
- All Known Subinterfaces:
IEvlContextParallel
- All Known Implementing Classes:
EvlContext
,EvlContextParallel
-
Field Summary
-
Method Summary
Modifier and TypeMethodDescriptiondefault Set<Constraint>
Used internally to determine evaluated constraints.Casts the IModule to IEvlModuleThis collection is written to internally by the engine during execution.default Map<Constraint,
Integer> default boolean
hasFixes()
boolean
Return true if the constraint results cache is optimized.boolean
Option allowing validation to terminate early when any invariant is unsatisfied.void
setOptimizeConstraintTrace
(boolean optimized) Set the flag for using optimized contraint result caching.void
setShortCircuit
(boolean shortCircuit) Sets whether short-circuited validation is enabled.default boolean
shouldShortCircuit
(Constraint constraint) Checks whether the condition for short-circuiting is met, either by previous invocation returning true or if there are unsatisfied constraints and theisShortCircuiting()
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.default Map<Constraint,
Set<Object>> default Set<UnsatisfiedConstraint>
This method is called internally once all constraints have been processed to convert the underlying collection ingetUnsatisfiedConstraints()
to a unique one.Methods inherited from interface org.eclipse.epsilon.eol.execute.context.IEolContext
dispose, getAsyncStatementsQueue, getErrorStream, getExtendedProperties, getFrameStack, getIntrospectionManager, getModelRepository, getNativeTypeDelegates, getOperationContributorRegistry, getOperationFactory, getOutputStream, getPrettyPrinterManager, getUserInput, getWarningStream, isAssertionsEnabled, isProfilingEnabled, setAssertionsEnabled, setErrorStream, setExecutorFactory, setExtendedProperties, setFrameStack, setIntrospectionManager, setModelRepository, setModule, setNativeTypeDelegates, setOperationFactory, setOutputStream, setPrettyPrinterManager, setProfilingEnabled, setUserInput, setWarningStream
Methods inherited from interface org.eclipse.epsilon.erl.execute.context.IErlContext
getExecutorFactory
-
Field Details
-
OPTIMIZE_CONSTRAINT_TRACE
- Since:
- 1.6
- See Also:
-
SHORT_CIRCUIT
- Since:
- 1.6
- See Also:
-
-
Method Details
-
getModule
IEvlModule getModule()Casts the IModule to IEvlModule- Specified by:
getModule
in interfaceIEolContext
- Specified by:
getModule
in interfaceIErlContext
- Since:
- 1.6
- See Also:
-
getUnsatisfiedConstraints
Collection<UnsatisfiedConstraint> getUnsatisfiedConstraints()This collection is written to internally by the engine during execution. AlthoughIEvlModule.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
This method is called internally once all constraints have been processed to convert the underlying collection ingetUnsatisfiedConstraints()
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:
-
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
Checks whether the condition for short-circuiting is met, either by previous invocation returning true or if there are unsatisfied constraints and theisShortCircuiting()
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
IllegalArgumentException
- If the rule parameter is not an appropriate type.- Since:
- 1.6
-
hasFixes
default boolean hasFixes()- Returns:
- Since:
- 1.6
-
sortUnsatisfiedConstraints
- Returns:
- A mapping from a Constraint to all of its unsatisfied instances.
- Since:
- 1.6
-
getUnsatisfiedConstraintsBySize
- Returns:
- A sorted entry of Constraints with the number of unsatisfied instances, in descending order.
- Since:
- 1.6
-
getConstraintsDependedOn
- Returns:
- Since:
- 1.6
-