Constructor and Description |
---|
OCLHelperImpl(OCL ocl,
EObject context)
Initializes me with my environment.
|
Modifier and Type | Method and Description |
---|---|
ExpressionInOCL |
createBodyCondition(String expression)
Creates an operation body.
|
ExpressionInOCL |
createDerivedValueExpression(String expression)
Creates a property derived value expression.
|
ExpressionInOCL |
createInvariant(String expression)
Creates an invariant constraint in the current classifier context.
|
ExpressionInOCL |
createPostcondition(String expression)
Creates an operation postcondition constraint.
|
ExpressionInOCL |
createPrecondition(String expression)
Creates an operation precondition constraint.
|
ExpressionInOCL |
createQuery(String expression)
Creates a query expression in the current classifier context.
|
Type |
getContextClass()
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.
|
EnvironmentFactory |
getEnvironmentFactory() |
MetamodelManager |
getMetamodelManager() |
OCL |
getOCL()
Obtains the OCL instance that created me.
|
public OCLHelperImpl(OCL ocl, EObject context) throws ParserException
ocl
- the OCL environmentParserException
public ExpressionInOCL createBodyCondition(String expression) throws ParserException
OCLHelper
createBodyCondition
in interface OCLHelper
expression
- 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 parsepublic ExpressionInOCL createDerivedValueExpression(String expression) throws ParserException
OCLHelper
createDerivedValueExpression
in interface OCLHelper
expression
- 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 propertypublic ExpressionInOCL createInvariant(String expression) throws ParserException
OCLHelper
createInvariant
in interface OCLHelper
expression
- the constraint expression (without any context
declaration). This must be a boolean-valued expressionParserException
- if the expression
fails to parsepublic ExpressionInOCL createPostcondition(String expression) throws ParserException
OCLHelper
createPostcondition
in interface OCLHelper
expression
- the constraint expression (without any context
declaration). This must be a boolean-valued expressionParserException
- if the expression
fails to parsepublic ExpressionInOCL createPrecondition(String expression) throws ParserException
OCLHelper
createPrecondition
in interface OCLHelper
expression
- the constraint expression (without any context
declaration). This must be a boolean-valued expressionParserException
- if the expression
fails to parsepublic ExpressionInOCL createQuery(String expression) throws ParserException
OCLHelper
createQuery
in interface OCLHelper
expression
- the expression (without any context declaration).
This expression can have any result type; it needs not be a booleanParserException
- if the expression
fails to parsepublic Type getContextClass()
OCLHelper
getContextClass
in interface OCLHelper
null
)public Property getContextProperty()
OCLHelper
getContextProperty
in interface OCLHelper
null
if there is only a
classifier or operation contextpublic Operation getContextOperation()
OCLHelper
getContextOperation
in interface OCLHelper
null
if there is only a
classifier or attribute contextpublic EnvironmentFactory getEnvironmentFactory()
public MetamodelManager getMetamodelManager()
Copyright © 2005, 2018 IBM Corporation and others. All Rights Reserved.