Package org.eclipse.epsilon.evl.dom
Class Constraint
java.lang.Object
org.eclipse.epsilon.common.module.AbstractModuleElement
org.eclipse.epsilon.eol.dom.AnnotatableModuleElement
org.eclipse.epsilon.erl.dom.NamedRule
org.eclipse.epsilon.evl.dom.Constraint
- All Implemented Interfaces:
ModuleElement,IExecutableModuleElementParameter
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected ExecutableBlock<Boolean>protected ConstraintContextprotected ExecutableBlock<Boolean>protected booleanprotected booleanThis will be set totruebySatisfiesOperation.protected ExecutableBlock<String>Fields inherited from class org.eclipse.epsilon.erl.dom.NamedRule
nameExpressionFields inherited from class org.eclipse.epsilon.eol.dom.AnnotatableModuleElement
annotationBlock -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidaccept(IEvlVisitor visitor) booleanappliesTo(Object object, IEvlContext context) voidcheck(Object self, IEvlContext context) booleanexecute(IEolContext context_, Object self) protected booleanexecuteCheckBlock(Object self, IEvlContext context) getFixes()getUnsatisfiedMessage(Object self, IEvlContext context) Returns the message to be used in UnsatisfiedConstraint.getMessage().booleanChecks whether this constraint's guard block has dependencies on other constraint(s).inthashCode()booleanbooleanbooleanisInfo()booleanisLazy(IEvlContext context) booleanoptimisedCheck(Object self, IEvlContext context, boolean result) protected booleanpostprocessCheck(Object self, IEvlContext context, UnsatisfiedConstraint unsatisfiedConstraint, boolean result) protected UnsatisfiedConstraintpreprocessCheck(Object self, IEvlContext context) voidUsed to flag this constraint as the target of a dependency.voidsetCheckBlock(ExecutableBlock<Boolean> checkBlock) voidsetConstraintContext(ConstraintContext constraintContext) voidsetCritique(boolean isCritique) voidsetGuardBlock(ExecutableBlock<Boolean> guardBlock) voidsetMessageBlock(ExecutableBlock<String> messageBlock) booleanshouldBeChecked(Object modelElement, IEvlContext context) Methods inherited from class org.eclipse.epsilon.erl.dom.NamedRule
getName, getNameAst, getNameExpression, toStringMethods inherited from class org.eclipse.epsilon.eol.dom.AnnotatableModuleElement
accept, getAnnotation, getAnnotationBlock, getAnnotations, getAnnotationsValues, getBooleanAnnotationValue, getBooleanAnnotationValue, getBooleanAnnotationValue, getBooleanAnnotationValue, hasAnnotation, setAnnotationBlockMethods inherited from class org.eclipse.epsilon.common.module.AbstractModuleElement
getChildren, getComments, getData, getDebugInfo, getFile, getModule, getParent, getRegion, getUri, setModule, setParent, setRegion, setUriMethods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface org.eclipse.epsilon.common.module.ModuleElement
getChildren, getComments, getData, getFile, getModule, getParent, getRegion, getUri, setModule, setParent, setRegion, setUri
-
Field Details
-
isCritique
protected boolean isCritique -
fixes
-
constraintContext
-
guardBlock
-
checkBlock
-
messageBlock
-
isDependedOn
protected boolean isDependedOnThis will be set totruebySatisfiesOperation.- Since:
- 1.6
-
-
Constructor Details
-
Constraint
public Constraint()
-
-
Method Details
-
build
- Specified by:
buildin interfaceModuleElement- Overrides:
buildin classNamedRule
-
isInfo
public boolean isInfo() -
isLazy
- Throws:
EolRuntimeException
-
shouldBeChecked
- Throws:
EolRuntimeException
-
execute
public Optional<UnsatisfiedConstraint> execute(IEolContext context_, Object self) throws EolRuntimeException - Specified by:
executein interfaceIExecutableModuleElementParameter- Throws:
EolRuntimeException
-
appliesTo
- Throws:
EolRuntimeException
-
optimisedCheck
public boolean optimisedCheck(Object self, IEvlContext context, boolean result) throws EolRuntimeException - Parameters:
self-context-result-- Returns:
- Throws:
EolRuntimeException- Since:
- 1.6
-
check
public Optional<UnsatisfiedConstraint> check(Object self, IEvlContext context) throws EolRuntimeException - Parameters:
self-context-- Returns:
- Throws:
EolRuntimeException- Since:
- 1.6
-
preprocessCheck
-
executeCheckBlock
- Parameters:
self-context-- Returns:
- Throws:
EolRuntimeException- Since:
- 1.6
-
postprocessCheck
protected boolean postprocessCheck(Object self, IEvlContext context, UnsatisfiedConstraint unsatisfiedConstraint, boolean result) throws EolRuntimeException - Throws:
EolRuntimeException
-
getUnsatisfiedMessage
Returns the message to be used in UnsatisfiedConstraint.getMessage().- Parameters:
self- The model element.context- The execution context.- Returns:
- The message if this Constraint's check block returns false.
- Throws:
EolRuntimeException- Since:
- 1.6
-
guardBlockUsesSatisfies
public boolean guardBlockUsesSatisfies()Checks whether this constraint's guard block has dependencies on other constraint(s).- Returns:
trueif the guard block exists and has a satisfies call.- Since:
- 1.6
-
getConstraintContext
-
setConstraintContext
-
isCritique
public boolean isCritique() -
setCritique
public void setCritique(boolean isCritique) -
isDependedOn
public boolean isDependedOn()- Returns:
- Whether this constraint is the target of a dependency.
- Since:
- 1.6
-
setAsDependency
public void setAsDependency()Used to flag this constraint as the target of a dependency.- Since:
- 1.6
-
hashCode
public int hashCode() -
equals
-
getGuardBlock
-
setGuardBlock
-
getCheckBlock
-
setCheckBlock
-
getMessageBlock
-
setMessageBlock
-
getFixes
-
accept
-