|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.eclipse.ocl.examples.pivot.helper.OCLHelperImpl
public class OCLHelperImpl
Implementation of the OCLMetaModel.Helper convenience interface.
| Field Summary | |
|---|---|
protected EnvironmentFactory |
environmentFactory
|
protected MetaModelManager |
metaModelManager
|
protected Environment |
rootEnvironment
|
| Constructor Summary | |
|---|---|
OCLHelperImpl(OCL ocl)
Initializes me with my environment. |
|
| 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)
|
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()
Obtains the environment defining my current classifier, operation, or attribute context. |
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. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected final Environment rootEnvironment
protected final MetaModelManager metaModelManager
protected final EnvironmentFactory environmentFactory
| Constructor Detail |
|---|
public OCLHelperImpl(OCL ocl)
ocl - the OCL environment| Method Detail |
|---|
public ExpressionInOCL createBodyCondition(java.lang.String expression)
throws ParserException
OCLHelper
createBodyCondition 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)
public ExpressionInOCL createDerivedValueExpression(java.lang.String expression)
throws ParserException
OCLHelper
createDerivedValueExpression in interface OCLHelperexpression - 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#setPropertyContext(Object, Object)
public ExpressionInOCL createInvariant(java.lang.String expression)
throws ParserException
OCLHelper
createInvariant in interface OCLHelperexpression - the constraint expression (without any context
declaration). This must be a boolean-valued expression
ParserException - if the expression fails to parse
public ExpressionInOCL createPostcondition(java.lang.String expression)
throws ParserException
OCLHelper
createPostcondition in interface OCLHelperexpression - 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
createPrecondition in interface OCLHelperexpression - 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
createQuery in interface OCLHelperexpression - 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 parse
protected ExpressionInOCL createSpecification(java.lang.String expression)
throws ParserException
ParserExceptionpublic Property getContextProperty()
OCLHelper
getContextProperty in interface OCLHelpernull if there is only a
classifier or operation contextpublic Type getContextClassifier()
OCLHelper
getContextClassifier in interface OCLHelpernull)public Operation getContextOperation()
OCLHelper
getContextOperation in interface OCLHelpernull if there is only a
classifier or attribute contextpublic Environment getEnvironment()
OCLHelper
getEnvironment in interface OCLHelpernull if I have
not yet been assigned a context#setContext(Object),
#setOperationContext(Object, Object),
#setPropertyContext(Object, Object)public OCL getOCL()
OCLHelper
getOCL in interface OCLHelperpublic org.eclipse.emf.common.util.Diagnostic getProblems()
OCLHelper
getProblems in interface OCLHelpernull if all was OKpublic boolean isValidating()
OCLHelper
isValidating in interface OCLHelperpublic void setContext(org.eclipse.emf.ecore.EClassifier context)
OCLHelper
setContext in interface OCLHelpercontext - the OCL context classifier#setOperationContext(Object, Object),
#setPropertyContext(Object, Object)public void setContext(Type context)
OCLHelper
setContext in interface OCLHelpercontext - the OCL context classifier#setOperationContext(Object, Object),
#setPropertyContext(Object, Object)
public void setInstancePropertyContext(java.lang.Object instance,
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(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(java.lang.Object instance,
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(org.eclipse.emf.ecore.EClassifier context,
org.eclipse.emf.ecore.EOperation operation)
OCLHelper
setOperationContext in interface OCLHelpercontext - the OCL context classifieroperation - the OCL context operation#setContext(Object)
public void setOperationContext(Type context,
Operation operation)
OCLHelper
setOperationContext in interface OCLHelpercontext - the OCL context classifieroperation - the OCL context operation#setContext(Object)
public void setPropertyContext(org.eclipse.emf.ecore.EClassifier context,
org.eclipse.emf.ecore.EStructuralFeature property)
OCLHelper
setPropertyContext in interface OCLHelpercontext - the OCL context classifierproperty - the OCL context attribute#setContext(Object)
public void setPropertyContext(Type context,
Property property)
OCLHelper
setPropertyContext in interface OCLHelpercontext - the OCL context classifierproperty - the OCL context attribute#setContext(Object)public void setValidating(boolean validating)
OCLHelper
setValidating in interface OCLHelpervalidating - whether I should validate parsed expressions
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||