public class Constraint extends NamedRule implements IExecutableModuleElementParameter
Modifier and Type | Field and Description |
---|---|
protected ExecutableBlock<Boolean> |
checkBlock |
protected ConstraintContext |
constraintContext |
protected List<Fix> |
fixes |
protected ExecutableBlock<Boolean> |
guardBlock |
protected boolean |
isCritique |
protected boolean |
isDependedOn
This will be set to
true by SatisfiesOperation . |
protected ExecutableBlock<String> |
messageBlock |
nameExpression
annotationBlock
Constructor and Description |
---|
Constraint() |
Modifier and Type | Method and Description |
---|---|
boolean |
appliesTo(Object object,
IEvlContext context) |
void |
build(AST cst,
IModule module) |
Optional<UnsatisfiedConstraint> |
check(Object self,
IEvlContext context) |
boolean |
equals(Object other) |
Optional<UnsatisfiedConstraint> |
execute(IEolContext context_,
Object self) |
protected boolean |
executeCheckBlock(Object self,
IEvlContext context) |
ConstraintContext |
getConstraintContext() |
String |
getUnsatisfiedMessage(Object self,
IEvlContext context)
Returns the message to be used in UnsatisfiedConstraint.getMessage().
|
boolean |
guardBlockUsesSatisfies()
Checks whether this constraint's guard block has dependencies on other constraint(s).
|
int |
hashCode() |
boolean |
isCritique() |
boolean |
isDependedOn() |
boolean |
isInfo() |
boolean |
isLazy(IEvlContext context) |
boolean |
optimisedCheck(Object self,
IEvlContext context,
boolean result) |
protected boolean |
postprocessCheck(Object self,
IEvlContext context,
UnsatisfiedConstraint unsatisfiedConstraint,
boolean result) |
protected UnsatisfiedConstraint |
preprocessCheck(Object self,
IEvlContext context) |
void |
setAsDependency()
Used to flag this constraint as the target of a dependency.
|
void |
setConstraintContext(ConstraintContext constraintContext) |
void |
setCritique(boolean isCritique) |
boolean |
shouldBeChecked(Object modelElement,
IEvlContext context) |
getName, getNameAst, getNameExpression, setNameExpression, toString
getAnnotation, getAnnotationBlock, getAnnotations, getAnnotationsValues, getBooleanAnnotationValue, getBooleanAnnotationValue, getBooleanAnnotationValue, getBooleanAnnotationValue, hasAnnotation, setAnnotationBlock
getChildren, getComments, getDebugInfo, getFile, getModule, getParent, getRegion, getUri, setModule, setParent, setRegion, setUri
protected boolean isCritique
protected ConstraintContext constraintContext
protected ExecutableBlock<Boolean> guardBlock
protected ExecutableBlock<Boolean> checkBlock
protected ExecutableBlock<String> messageBlock
protected boolean isDependedOn
true
by SatisfiesOperation
.public void build(AST cst, IModule module)
build
in interface ModuleElement
build
in class NamedRule
public boolean isInfo()
public boolean isLazy(IEvlContext context) throws EolRuntimeException
EolRuntimeException
public boolean shouldBeChecked(Object modelElement, IEvlContext context) throws EolRuntimeException
EolRuntimeException
public Optional<UnsatisfiedConstraint> execute(IEolContext context_, Object self) throws EolRuntimeException
execute
in interface IExecutableModuleElementParameter
EolRuntimeException
public boolean appliesTo(Object object, IEvlContext context) throws EolRuntimeException
EolRuntimeException
public boolean optimisedCheck(Object self, IEvlContext context, boolean result) throws EolRuntimeException
self
- context
- result
- EolRuntimeException
public Optional<UnsatisfiedConstraint> check(Object self, IEvlContext context) throws EolRuntimeException
self
- context
- EolRuntimeException
protected UnsatisfiedConstraint preprocessCheck(Object self, IEvlContext context)
protected boolean executeCheckBlock(Object self, IEvlContext context) throws EolRuntimeException
self
- context
- EolRuntimeException
protected boolean postprocessCheck(Object self, IEvlContext context, UnsatisfiedConstraint unsatisfiedConstraint, boolean result) throws EolRuntimeException
EolRuntimeException
public String getUnsatisfiedMessage(Object self, IEvlContext context) throws EolRuntimeException
self
- The model element.context
- The execution context.EolRuntimeException
public boolean guardBlockUsesSatisfies()
true
if the guard block exists and has a satisfies call.public ConstraintContext getConstraintContext()
public void setConstraintContext(ConstraintContext constraintContext)
public boolean isCritique()
public void setCritique(boolean isCritique)
public boolean isDependedOn()
public void setAsDependency()
Copyright © 2020. All rights reserved.