|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.eclipse.ocl.examples.pivot.helper.OCLHelperImpl
public class OCLHelperImpl
Implementation of the OclMetaModel.Helper
convenience interface.
Constructor Summary | |
---|---|
OCLHelperImpl(OCL ocl)
|
Method Summary | |
---|---|
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)
|
Environment |
getEnvironment()
Obtains the environment defining my current classifier, operation, or attribute context. |
OCLBase |
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 |
setAttributeContext(Type context,
Property property)
Sets the attribute 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 |
setInstanceAttributeContext(java.lang.Object instance,
Property property)
Sets the operation context implied by the specified instance. |
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 |
setOperationContext(Type context,
Operation operation)
Sets the operation 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. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public OCLHelperImpl(OCL ocl)
Method Detail |
---|
public ExpressionInOcl createBodyCondition(java.lang.String expression) throws ParserException
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 parse#setOperationContext(Object, Object)
public ExpressionInOcl createDerivedValueExpression(java.lang.String expression) throws ParserException
OCLHelper
expression
- the derived value expression (without any context
declaration). This must conform to my context property type
ParserException
- if the expression
fails to parse
or is not valid for my context property#setAttributeContext(Object, Object)
public ExpressionInOcl createInvariant(java.lang.String expression) throws ParserException
OCLHelper
expression
- the constraint expression (without any context
declaration). This must be a boolean-valued expression
ParserException
- if the expression
fails to parsepublic ExpressionInOcl createPostcondition(java.lang.String expression) throws ParserException
OCLHelper
expression
- the constraint expression (without any context
declaration). This must be a boolean-valued expression
ParserException
- if the expression
fails to parse#setOperationContext(Object, Object)
public ExpressionInOcl createPrecondition(java.lang.String expression) throws ParserException
OCLHelper
expression
- the constraint expression (without any context
declaration). This must be a boolean-valued expression
ParserException
- if the expression
fails to parse#setOperationContext(Object, Object)
public ExpressionInOcl createQuery(java.lang.String expression) throws ParserException
OCLHelper
expression
- the expression (without any context declaration).
This expression can have any result type; it needs not be a boolean
ParserException
- if the expression
fails to parseprotected ExpressionInOcl createSpecification(java.lang.String expression) throws ParserException
ParserException
public Environment getEnvironment()
OCLHelper
getEnvironment
in interface OCLHelper
null
if I have
not yet been assigned a context#setContext(Object)
,
#setOperationContext(Object, Object)
,
#setAttributeContext(Object, Object)
public OCLBase getOCL()
OCLHelper
getOCL
in interface OCLHelper
public boolean isValidating()
OCLHelper
isValidating
in interface OCLHelper
public void setValidating(boolean validating)
OCLHelper
setValidating
in interface OCLHelper
validating
- whether I should validate parsed expressionspublic void setContext(Type context)
OCLHelper
setContext
in interface OCLHelper
context
- the OCL context classifier#setOperationContext(Object, Object)
,
#setAttributeContext(Object, Object)
public void setOperationContext(Type context, Operation operation)
OCLHelper
setOperationContext
in interface OCLHelper
context
- the OCL context classifieroperation
- the OCL context operation#setContext(Object)
public void setAttributeContext(Type context, Property property)
OCLHelper
setAttributeContext
in interface OCLHelper
context
- the OCL context classifierproperty
- the OCL context attribute#setContext(Object)
public void setInstanceContext(java.lang.Object instance)
OCLHelper
This method is convenient for ad hoc parsing and evaluation of OCL constraints or expressions in the context of a model instance.
setInstanceContext
in interface OCLHelper
instance
- the OCL context instance#setContext(Object)
public void setInstanceOperationContext(java.lang.Object instance, Operation operation)
OCLHelper
This method is convenient for ad hoc parsing and evaluation of OCL constraints or expressions in the context of a model instance.
setInstanceOperationContext
in interface OCLHelper
instance
- the OCL context instanceoperation
- the OCL context operation#setOperationContext(Object, Object)
public void setInstanceAttributeContext(java.lang.Object instance, Property property)
OCLHelper
This method is convenient for ad hoc parsing and evaluation of OCL constraints or expressions in the context of a model instance.
setInstanceAttributeContext
in interface OCLHelper
instance
- the OCL context instanceproperty
- the OCL context attribute#setAttributeContext(Object, Object)
public org.eclipse.emf.common.util.Diagnostic getProblems()
OCLHelper
getProblems
in interface OCLHelper
null
if all was OK
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |