| Modifier and Type | Field and Description |
|---|---|
protected EnvironmentFactory |
environmentFactory |
protected MetaModelManager |
metaModelManager |
protected Environment |
rootEnvironment |
| Constructor and Description |
|---|
OCLHelperImpl(OCL ocl)
Initializes me with my environment.
|
| Modifier and Type | Method and Description |
|---|---|
ExpressionInOCL |
createBodyCondition(java.lang.String expression)
Creates an operation body.
|
ExpressionInOCL |
createDerivedValueExpression(java.lang.String expression)
Creates a property derived value expression.
|
ExpressionInOCL |
createInvariant(java.lang.String expression)
Creates an invariant constraint in the current classifier context.
|
ExpressionInOCL |
createPostcondition(java.lang.String expression)
Creates an operation postcondition constraint.
|
ExpressionInOCL |
createPrecondition(java.lang.String expression)
Creates an operation precondition constraint.
|
ExpressionInOCL |
createQuery(java.lang.String expression)
Creates a query expression in the current classifier context.
|
protected ExpressionInOCL |
createSpecification(java.lang.String expression) |
Type |
getContextClassifier()
Obtains my OCL context classifier as a classifier.
|
Operation |
getContextOperation()
Obtains my context operation, if my environment is an operation context.
|
Property |
getContextProperty()
Obtains my context attribute, if my environment is an attribute context.
|
Environment |
getEnvironment()
|
MetaModelManager |
getMetaModelManager() |
OCL |
getOCL()
Obtains the OCL instance that created me.
|
org.eclipse.emf.common.util.Diagnostic |
getProblems()
Obtains problems, if any, found in parsing the last OCL constraint or
query expression.
|
boolean |
isValidating()
Queries whether I validate the expressions that I parse.
|
void |
setContext(org.eclipse.emf.ecore.EClassifier context)
Sets the classifier context of the OCL expression for which syntax or
parsing help is to be provided.
|
void |
setContext(Type context)
Sets the classifier context of the OCL expression for which syntax or
parsing help is to be provided.
|
void |
setInstanceContext(java.lang.Object instance)
Sets the classifier context implied by the specified instance.
|
void |
setInstanceOperationContext(java.lang.Object instance,
Operation operation)
Sets the operation context implied by the specified instance.
|
void |
setInstancePropertyContext(java.lang.Object instance,
Property property)
Sets the operation context implied by the specified instance.
|
void |
setOperationContext(org.eclipse.emf.ecore.EClassifier context,
org.eclipse.emf.ecore.EOperation operation)
Sets the operation context of the OCL expression for which syntax or
parsing help is to be provided.
|
void |
setOperationContext(Type context,
Operation operation)
Sets the operation context of the OCL expression for which syntax or
parsing help is to be provided.
|
void |
setPropertyContext(org.eclipse.emf.ecore.EClassifier context,
org.eclipse.emf.ecore.EStructuralFeature property)
Sets the attribute context of the OCL expression for which syntax or
parsing help is to be provided.
|
void |
setPropertyContext(Type context,
Property property)
Sets the attribute context of the OCL expression for which syntax or
parsing help is to be provided.
|
void |
setValidating(boolean validating)
Sets whether I should validate the expressions that I parse.
|
@NonNull protected final Environment rootEnvironment
@NonNull protected final MetaModelManager metaModelManager
@NonNull protected final EnvironmentFactory environmentFactory
public OCLHelperImpl(@NonNull
OCL ocl)
ocl - the OCL environment@NonNull public ExpressionInOCL createBodyCondition(@NonNull java.lang.String expression) throws ParserException
OCLHelpercreateBodyCondition in interface OCLHelperexpression - the constraint expression (without any context
declaration). Ordinarily, this is an expression of the same type
as the operation, specifying the value of the operation.
Alternatively, this may be a boolean-valued expression phrased like
a post-condition (according to the well-formedness rules of UML
constraints)ParserException - if the expression fails to parse#setOperationContext(Object, Object)@NonNull public ExpressionInOCL createDerivedValueExpression(@NonNull java.lang.String expression) throws ParserException
OCLHelpercreateDerivedValueExpression in interface OCLHelperexpression - the derived value expression (without any context
declaration). This must conform to my context property typeParserException - if the expression fails to parse
or is not valid for my context property#setPropertyContext(Object, Object)@NonNull public ExpressionInOCL createInvariant(@NonNull java.lang.String expression) throws ParserException
OCLHelpercreateInvariant in interface OCLHelperexpression - the constraint expression (without any context
declaration). This must be a boolean-valued expressionParserException - if the expression fails to parse@NonNull public ExpressionInOCL createPostcondition(@NonNull java.lang.String expression) throws ParserException
OCLHelpercreatePostcondition in interface OCLHelperexpression - the constraint expression (without any context
declaration). This must be a boolean-valued expressionParserException - if the expression fails to parse#setOperationContext(Object, Object)@NonNull public ExpressionInOCL createPrecondition(@NonNull java.lang.String expression) throws ParserException
OCLHelpercreatePrecondition in interface OCLHelperexpression - the constraint expression (without any context
declaration). This must be a boolean-valued expressionParserException - if the expression fails to parse#setOperationContext(Object, Object)@NonNull public ExpressionInOCL createQuery(@NonNull java.lang.String expression) throws ParserException
OCLHelpercreateQuery in interface OCLHelperexpression - the expression (without any context declaration).
This expression can have any result type; it needs not be a booleanParserException - if the expression fails to parse@NonNull protected ExpressionInOCL createSpecification(@NonNull java.lang.String expression) throws ParserException
ParserException@Nullable public Property getContextProperty()
OCLHelpergetContextProperty in interface OCLHelpernull if there is only a
classifier or operation context@Nullable public Type getContextClassifier()
OCLHelpergetContextClassifier in interface OCLHelpernull)@Nullable public Operation getContextOperation()
OCLHelpergetContextOperation in interface OCLHelpernull if there is only a
classifier or attribute context@NonNull public Environment getEnvironment()
OCLHelpergetEnvironment in interface OCLHelpernull if I have
not yet been assigned a context#setContext(Object),
#setOperationContext(Object, Object),
#setPropertyContext(Object, Object)@NonNull public final MetaModelManager getMetaModelManager()
@NonNull public OCL getOCL()
OCLHelperpublic org.eclipse.emf.common.util.Diagnostic getProblems()
OCLHelpergetProblems in interface OCLHelpernull if all was OKpublic boolean isValidating()
OCLHelperisValidating in interface OCLHelperpublic void setContext(@NonNull
org.eclipse.emf.ecore.EClassifier context)
OCLHelpersetContext in interface OCLHelpercontext - the OCL context classifier#setOperationContext(Object, Object),
#setPropertyContext(Object, Object)public void setContext(@NonNull
Type context)
OCLHelpersetContext in interface OCLHelpercontext - the OCL context classifier#setOperationContext(Object, Object),
#setPropertyContext(Object, Object)public void setInstancePropertyContext(@NonNull
java.lang.Object instance,
@NonNull
Property property)
OCLHelperThis method is convenient for ad hoc parsing and evaluation of OCL constraints or expressions in the context of a model instance.
setInstancePropertyContext in interface OCLHelperinstance - the OCL context instanceproperty - the OCL context attribute#setPropertyContext(Object, Object)public void setInstanceContext(@NonNull
java.lang.Object instance)
OCLHelperThis method is convenient for ad hoc parsing and evaluation of OCL constraints or expressions in the context of a model instance.
setInstanceContext in interface OCLHelperinstance - the OCL context instance#setContext(Object)public void setInstanceOperationContext(@NonNull
java.lang.Object instance,
@NonNull
Operation operation)
OCLHelperThis method is convenient for ad hoc parsing and evaluation of OCL constraints or expressions in the context of a model instance.
setInstanceOperationContext in interface OCLHelperinstance - the OCL context instanceoperation - the OCL context operation#setOperationContext(Object, Object)public void setOperationContext(@NonNull
org.eclipse.emf.ecore.EClassifier context,
@NonNull
org.eclipse.emf.ecore.EOperation operation)
OCLHelpersetOperationContext in interface OCLHelpercontext - the OCL context classifieroperation - the OCL context operation#setContext(Object)public void setOperationContext(@NonNull
Type context,
@NonNull
Operation operation)
OCLHelpersetOperationContext in interface OCLHelpercontext - the OCL context classifieroperation - the OCL context operation#setContext(Object)public void setPropertyContext(@NonNull
org.eclipse.emf.ecore.EClassifier context,
@NonNull
org.eclipse.emf.ecore.EStructuralFeature property)
OCLHelpersetPropertyContext in interface OCLHelpercontext - the OCL context classifierproperty - the OCL context attribute#setContext(Object)public void setPropertyContext(@NonNull
Type context,
@NonNull
Property property)
OCLHelpersetPropertyContext in interface OCLHelpercontext - the OCL context classifierproperty - the OCL context attribute#setContext(Object)public void setValidating(boolean validating)
OCLHelpersetValidating in interface OCLHelpervalidating - whether I should validate parsed expressions