|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.eclipse.emf.query.conditions.Condition org.eclipse.emf.query.conditions.eobjects.EObjectCondition org.eclipse.emf.query.ocl.conditions.OCLCondition
AbstractOCLCondition
class, which supports
customization of the OCL parsing environment as well as other metamodels
than Ecore
@Deprecated public abstract class OCLCondition
An abstract OCL condition class, used to apply OCL expressions to
EObject
s. It allows the integration of OCL expressions with other
EObjectCondition
s.
This supports OCL expressions with or without an OCL classifier
(EClass
) context. Expressions that have no OCL classifier context
are context-free. Such conditions are useful
in situations where either the elements on which the expressions will be
evaluated are of an unknown type or where the same expression might be
applicable to multiple, unrelated context types.
Note that this class is not intended to be extended "directly"
by clients. Clients may extend the OCLConstraintCondition
class.
OCLConstraintCondition
Field Summary |
---|
Fields inherited from class org.eclipse.emf.query.conditions.eobjects.EObjectCondition |
---|
E_FALSE, E_TRUE |
Fields inherited from class org.eclipse.emf.query.conditions.Condition |
---|
FALSE, TRUE |
Constructor Summary | |
---|---|
protected |
OCLCondition(Query oclQuery,
EClass contextEObjectType,
IEStructuralFeatureValueGetter eStructuralFeatureValueGetter,
PruneHandler pruneHandler)
Deprecated. Initializes a query condition with a compiled OCL query, an EClass representing the EObject type which the OCL
expression uses as a context, an IEStructuralFeatureValueGetter
to use to get values of EStructuralFeature s
referenced by the OCL expression, and a PruneHandler to consult
for pruning the content tree. |
protected |
OCLCondition(String oclExpressionString,
EClass contextEObjectType,
IEStructuralFeatureValueGetter eStructuralFeatureValueGetter)
Deprecated. Initializes a query condition with an OCL expression string, an EClass representing the EObject type which the OCL
expression uses as a context, and an
IEStructuralFeatureValueGetter to use to get values of
EStructuralFeature s referenced by the OCL
expression. |
protected |
OCLCondition(String oclExpressionString,
EClass contextEObjectType,
IEStructuralFeatureValueGetter eStructuralFeatureValueGetter,
PruneHandler pruneHandler)
Deprecated. Initializes a query condition with an OCL expression string, an EClass representing the EObject type which the OCL
expression uses as a context, an IEStructuralFeatureValueGetter
to use to get values of EStructuralFeature s
referenced by the OCL expression, and a PruneHandler to consult
for pruning the content tree. |
Method Summary | |
---|---|
Object |
evaluate(EObject eObject)
Deprecated. Evaluates the OCL condition. |
protected EClass |
getContextEObjectType()
Deprecated. Return the context EClass . |
IEStructuralFeatureValueGetter |
getEStructuralFeatureValueGetter()
Deprecated. Retrieves the strategy used by this OCLCondition to access
the values of EStructuralFeature s of model
elements. |
protected Query |
getOclQuery()
Deprecated. Obtains the query compiled by the OCL interpreter, which represents the OCL expression. |
EClassifier |
getResultType(EObject eObject)
Deprecated. Returns the type of the ocl expression. |
protected boolean |
isContextFree()
Deprecated. Queries whether this OCLCondition is context-free. |
boolean |
isSatisfied(EObject eObject)
Deprecated. Checks to see if an eObject is of a type conformant to the
context of this OCLCondition . |
void |
setEStructuralFeatureValueGetter(IEStructuralFeatureValueGetter eStructuralFeatureValueGetter)
Deprecated. Assigns the strategy to be used by this OCLCondition to
access the values of EStructuralFeature s
of model elements. |
Methods inherited from class org.eclipse.emf.query.conditions.eobjects.EObjectCondition |
---|
AND, EQUIVALENT, getPruneHandler, IMPLIES, isSatisfied, OR, shouldPrune, XOR |
Methods inherited from class org.eclipse.emf.query.conditions.Condition |
---|
AND, EQUIVALENT, IMPLIES, OR, XOR |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
protected OCLCondition(String oclExpressionString, EClass contextEObjectType, IEStructuralFeatureValueGetter eStructuralFeatureValueGetter)
EClass
representing the EObject
type which the OCL
expression uses as a context, and an
IEStructuralFeatureValueGetter
to use to get values of
EStructuralFeature
s referenced by the OCL
expression. It defaults to using PruneHandler.NEVER
to consult
for pruning.
NOTE: if contextEObjectType
is null
,
then this becomes a context-free OCL condition.
oclExpressionString
- The OCL expression to apply when evaluating this
OCLCondition
contextEObjectType
- The EClass
representing the OCL context classifier.
Use null
to create a context-free
OCLCondition
.eStructuralFeatureValueGetter
- The strategy for accessing structural feature values. It
serves as a layer of indirection to allow clients to intervene
between this condition object and the way it extracts the
EStructuralFeature
s' values so
as to allow for manipulation of such values before subjecting
them to evaluation by the OCL interpreter.protected OCLCondition(String oclExpressionString, EClass contextEObjectType, IEStructuralFeatureValueGetter eStructuralFeatureValueGetter, PruneHandler pruneHandler)
EClass
representing the EObject
type which the OCL
expression uses as a context, an IEStructuralFeatureValueGetter
to use to get values of EStructuralFeature
s
referenced by the OCL expression, and a PruneHandler
to consult
for pruning the content tree.
NOTE: if contextEObjectType
is null
,
then this becomes a context-free OCL condition.
oclExpressionString
- The OCL expression to apply when evaluating this
OCLCondition
contextEObjectType
- The EClass
representing the OCL context classifier.
Use null
to create a context-free
OCLCondition
.eStructuralFeatureValueGetter
- The strategy for accessing structural feature values. It
serves as a layer of indirection to allow clients to intervene
between this condition object and the way it extracts the
EStructuralFeature
s' values so
as to allow for manipulation of such values before subjecting
them to evaluation by the OCL interpreter.pruneHandler
- The PruneHandler
to consult when pruningprotected OCLCondition(Query oclQuery, EClass contextEObjectType, IEStructuralFeatureValueGetter eStructuralFeatureValueGetter, PruneHandler pruneHandler)
EClass
representing the EObject
type which the OCL
expression uses as a context, an IEStructuralFeatureValueGetter
to use to get values of EStructuralFeature
s
referenced by the OCL expression, and a PruneHandler
to consult
for pruning the content tree.
oclQuery
- The OCL query to apply when evaluating this
OCLCondition
contextEObjectType
- The EClass
representing the OCL context classifier.
Must not be null
.eStructuralFeatureValueGetter
- The strategy for accessing structural feature values. It
serves as a layer of indirection to allow clients to intervene
between this condition object and the way it extracts the
EStructuralFeature
s' values so
as to allow for manipulation of such values before subjecting
them to evaluation by the OCL interpreter.pruneHandler
- The PruneHandler
to consult when pruningMethod Detail |
---|
protected final Query getOclQuery()
null
if
the condition is context-free and has not been initialized by
invocation of the isSatisfied(EObject)
methodisContextFree()
,
isSatisfied(EObject)
,
getResultType(EObject)
public boolean isSatisfied(EObject eObject)
eObject
is of a type conformant to the
context of this OCLCondition
.
isSatisfied
in class EObjectCondition
eObject
- the EObject
to check
true
if the argument eObject satisfies
this EObjectCondition
getContextEObjectType()
,
isContextFree()
public EClassifier getResultType(EObject eObject)
null
in the case of a context-free OCL condition.
In the case of a context-free OCL condition, a context
eObject
is required to guess the result type of the
expression. It is expected that the condition would subsequently be
evaluated on objects of the same type as the eObject
.
eObject
- required in the case of a context-free OCL condition, to
specify a context object. Otherwise, it is ignored and
a null
value is acceptable
EClass
from your EMF metamodel
or it may be an EDataType
representing a Java language typeisContextFree()
,
evaluate(EObject)
protected final boolean isContextFree()
OCLCondition
is context-free.
true
if this is a context-free OCL condition;
false
, otherwisegetResultType(EObject)
,
isSatisfied(EObject)
public final IEStructuralFeatureValueGetter getEStructuralFeatureValueGetter()
OCLCondition
to access
the values of EStructuralFeature
s of model
elements.
public final void setEStructuralFeatureValueGetter(IEStructuralFeatureValueGetter eStructuralFeatureValueGetter)
OCLCondition
to
access the values of EStructuralFeature
s
of model elements.
eStructuralFeatureValueGetter
- the structural feature value
accessor to usepublic Object evaluate(EObject eObject)
eObject
- Context for evaluation; can be null
if the OCL
expression has no "self" object
EObject
or a Java object), or any kind of
collection of such objectsprotected final EClass getContextEObjectType()
EClass
. Could be null
if this is a context-free OCL condition.
isContextFree()
|
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 |