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 |
nameExpressionannotationBlock| 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, toStringgetAnnotation, getAnnotationBlock, getAnnotations, getAnnotationsValues, getBooleanAnnotationValue, getBooleanAnnotationValue, getBooleanAnnotationValue, getBooleanAnnotationValue, hasAnnotation, setAnnotationBlockgetChildren, getComments, getDebugInfo, getFile, getModule, getParent, getRegion, getUri, setModule, setParent, setRegion, setUriprotected 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 ModuleElementbuild in class NamedRulepublic boolean isInfo()
public boolean isLazy(IEvlContext context) throws EolRuntimeException
EolRuntimeExceptionpublic boolean shouldBeChecked(Object modelElement, IEvlContext context) throws EolRuntimeException
EolRuntimeExceptionpublic Optional<UnsatisfiedConstraint> execute(IEolContext context_, Object self) throws EolRuntimeException
execute in interface IExecutableModuleElementParameterEolRuntimeExceptionpublic boolean appliesTo(Object object, IEvlContext context) throws EolRuntimeException
EolRuntimeExceptionpublic boolean optimisedCheck(Object self, IEvlContext context, boolean result) throws EolRuntimeException
self - context - result - EolRuntimeExceptionpublic Optional<UnsatisfiedConstraint> check(Object self, IEvlContext context) throws EolRuntimeException
self - context - EolRuntimeExceptionprotected UnsatisfiedConstraint preprocessCheck(Object self, IEvlContext context)
protected boolean executeCheckBlock(Object self, IEvlContext context) throws EolRuntimeException
self - context - EolRuntimeExceptionprotected boolean postprocessCheck(Object self, IEvlContext context, UnsatisfiedConstraint unsatisfiedConstraint, boolean result) throws EolRuntimeException
EolRuntimeExceptionpublic String getUnsatisfiedMessage(Object self, IEvlContext context) throws EolRuntimeException
self - The model element.context - The execution context.EolRuntimeExceptionpublic 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.