|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
OCLHelper
interface, instead.
@Deprecated public interface IOCLHelper
A utility object that provides OCL syntax completion suggestions for OCL
expressions on the metamodel and user model levels. Metamodel OCL help is
available for any EMF metamodel via the EcoreEnvironmentFactory
, but
user model help is only available for metamodels for which an appropriate
specialized EnvironmentFactory
is available.
Helpers of these two flavours can be created via the
HelperUtil.createOCLHelper(EnvironmentFactory)
method.
Note that this interface is not intended to be implemented by clients.
HelperUtil.createOCLHelper(EnvironmentFactory)
Method Summary | |
---|---|
boolean |
check(Object context,
OCLExpression constraint)
Deprecated. Evaluates the specified constraint on an instance of my context classifier and returns whether the constraint is satisfied. |
boolean |
check(Object context,
String constraint)
Deprecated. Evaluates the specified constraint on an instance of my context classifier and returns whether the constraint is satisfied. |
OCLExpression |
createBodyCondition(String expression)
Deprecated. Creates an operation body. |
OCLExpression |
createDerivedValueExpression(String expression)
Deprecated. Creates a property derived value expression. |
OCLExpression |
createInitialValueExpression(String expression)
Deprecated. Creates a property initial value expression. |
OCLExpression |
createInvariant(String expression)
Deprecated. Creates an invariant constraint in the current classifier context. |
OCLExpression |
createPostcondition(String expression)
Deprecated. Creates an operation postcondition constraint. |
OCLExpression |
createPrecondition(String expression)
Deprecated. Creates an operation precondition constraint. |
OCLExpression |
createQuery(String expression)
Deprecated. Creates a query expression in the current classifier context. |
ETypedElement |
define(String defExpression)
Deprecated. Defines an additional property or operation in the context classifier, for use in formulating OCL queries and constraints. |
Object |
evaluate(Object context,
OCLExpression expression)
Deprecated. Evaluates the specified parsed OCL expression on an instance of my context classifier. |
Object |
evaluate(Object context,
String expression)
Deprecated. Evaluates the specified expression on an instance of my context classifier. |
EClassifier |
getContextClassifier()
Deprecated. Obtains my OCL context classifier as an EMF classifier. |
EOperation |
getContextOperation()
Deprecated. Obtains my context operation as an EMF operation, if my environment is an operation context. |
EStructuralFeature |
getContextProperty()
Deprecated. Obtains my context operation as an EMF property, if my environment is a property context. |
Environment |
getEnvironment()
Deprecated. Obtains the environment defining my current context classifier, operation, or property. |
EnvironmentFactory |
getEnvironmentFactory()
Deprecated. Retrieves the environment factory for the metamodel that I am helping. |
List |
getSyntaxHelp(ConstraintType constraintType,
String txt)
Deprecated. Obtains syntax completion choices for the specified fragment of an OCL expression given that it is intended for a constraint of the specified kind. |
List |
getSyntaxHelp(String txt)
Deprecated. Use the getSyntaxHelp(ConstraintType, String)
method, instead, to get the correct completions for the context |
void |
setContext(Object context)
Deprecated. Sets the context of the OCL expression for which syntax or parsing help is to be provided. |
void |
setContextOperation(Object context,
Object operation)
Deprecated. Sets the context of the OCL expression for which syntax or parsing help is to be provided. |
void |
setContextProperty(Object context,
Object property)
Deprecated. Sets the context of the OCL expression for which syntax or parsing help is to be provided. |
Method Detail |
---|
void setContext(Object context)
EClassifier
of the target metamodel against which an OCL
expression would be parsed. Note that, in the former case, the actual
OCL context classifier (as an OCL type or EClassifier
) will be
inferred from the context object according to the nature of the
environment factory.
context
- the OCL context object or classifiersetContextOperation(Object, Object)
EClassifier getContextClassifier()
null
)void setContextOperation(Object context, Object operation)
context
- the OCL context objectoperation
- the OCL context operationsetContext(Object)
EOperation getContextOperation()
null
if there is only a
classifier or property contextvoid setContextProperty(Object context, Object property)
context
- the OCL context objectproperty
- the OCL context propertysetContext(Object)
EStructuralFeature getContextProperty()
null
if there is only a
classifier or operation contextEnvironment getEnvironment()
null
if I have nonesetContext(Object)
,
setContextOperation(Object, Object)
,
setContextProperty(Object, Object)
@Deprecated List getSyntaxHelp(String txt)
getSyntaxHelp(ConstraintType, String)
method, instead, to get the correct completions for the context
getSyntaxHelp(ConstraintType, String)
method as it will provide
completions for syntax only available in these constraints.
txt
- a partial OCL expression for which to seek choices that
could be appended to it
Choice
s, possibly empty. The ordering of the
list may or may not indicate relative relevance or frequency of
a choiceList getSyntaxHelp(ConstraintType constraintType, String txt)
constraintType
- the kind of constraint that is being composedtxt
- a partial OCL expression for which to seek choices that
could be appended to it
Choice
s, possibly empty. The ordering of the
list may or may not indicate relative relevance or frequency of
a choiceOCLExpression createQuery(String expression) throws OCLParsingException
expression
- the constraint expression (without any context
declaration). This expression can have any result type; it needs not
be a boolean
OCLParsingException
- if the expression
fails to parseOCLExpression createInvariant(String expression) throws OCLParsingException
expression
- the constraint expression (without any context
declaration). This must be a boolean-valued expression
OCLParsingException
- if the expression
fails to parseOCLExpression createPrecondition(String expression) throws OCLParsingException
expression
- the constraint expression (without any context
declaration). This must be a boolean-valued expression
OCLParsingException
- if the expression
fails to parsesetContextOperation(Object, Object)
OCLExpression createPostcondition(String expression) throws OCLParsingException
expression
- the constraint expression (without any context
declaration). This must be a boolean-valued expression
OCLParsingException
- if the expression
fails to parsesetContextOperation(Object, Object)
OCLExpression createBodyCondition(String expression) throws OCLParsingException
expression
- the constraint expression (without any context
declaration). This must be a boolean-valued expression
OCLParsingException
- if the expression
fails to parsesetContextOperation(Object, Object)
OCLExpression createInitialValueExpression(String expression) throws OCLParsingException
expression
- the initial value expression (without any context
declaration). This must conform to my context property type
OCLParsingException
- if the expression
fails to parse
or is not valid for my context propertysetContextProperty(Object, Object)
OCLExpression createDerivedValueExpression(String expression) throws OCLParsingException
expression
- the derived value expression (without any context
declaration). This must conform to my context property type
OCLParsingException
- if the expression
fails to parse
or is not valid for my context propertysetContextProperty(Object, Object)
ETypedElement define(String defExpression) throws OCLParsingException
oroperation-name(parameters?) : type = expr
property-name : type = expr
defExpression
- the definition expression (without any other context
declaration).
EOperation
or EStructuralFeature
OCLParsingException
- if the expression
fails to parseObject evaluate(Object context, OCLExpression expression)
context
- the context object on which to evaluate the expression.
This is the self object, if the expression requires one.
Note that a context is required even for expressions that use the
allInstances() operation to get the instances of an OCL
classifier, in order to find resources to search for instances
(unless the context is a data type, in which case the instances are
not enumerated by models)expression
- an expression to evaluate
null
Object evaluate(Object context, String expression) throws OCLParsingException
context
- the context object on which to evaluate the expression.
This is the self object, if the expression requires one.
Note the it is required even for expressions that use the
allInstances() operation to get the instances of an OCL
classifier, in order to find resources to search for instances
(unless the context is a data type, in which case the instances are
not enumerated by models)expression
- an expression to evaluate
null
OCLParsingException
- if the expression
fails to parseevaluate(Object, OCLExpression)
boolean check(Object context, OCLExpression constraint)
context
- the context object on which to evaluate the expression.
This is the self object, if the expression requires one.
Note the it is required even for expressions that use the
allInstances() operation to get the instances of an OCL
classifier, in order to find resources to search for instances
(unless the context is a data type, in which case the instances are
not enumerated by models)constraint
- a constraint expression to evaluate
true
if the context
object satisfies
the constraint
; false
, otherwise
IllegalArgumentException
- if the constraint
is not
boolean-valuedboolean check(Object context, String constraint) throws OCLParsingException
context
- the context object on which to evaluate the expression.
This is the self object, if the expression requires one.
Note the it is required even for expressions that use the
allInstances() operation to get the instances of an OCL
classifier, in order to find resources to search for instances
(unless the context is a data type, in which case the instances are
not enumerated by models)constraint
- a constraint expression to evaluate
true
if the context
object satisfies
the constraint
; false
, otherwise
OCLParsingException
- if the expression
fails to parse
IllegalArgumentException
- if the constraint
is not
boolean-valuedcheck(Object, OCLExpression)
EnvironmentFactory getEnvironmentFactory()
null
)
|
Copyright 2002, 2007 IBM Corporation and others. All Rights Reserved. |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |