|
IBM Rational Software Modeler Release 6.0 |
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.ibm.xtools.emf.query.conditions.Condition
com.ibm.xtools.emf.query.conditions.eobjects.EObjectCondition
com.ibm.xtools.emf.query.ocl.conditions.OclCondition
A base abstract OCL condition class, it is used to apply OCL expression on
EObjects. It allows the integration of OCL expression with other
EObjectConditions. This class could be used to apply a context-free OCL
expression if the contextEClass (type) passed to the constructor is
null
.
Field Summary |
Fields inherited from class com.ibm.xtools.emf.query.conditions.eobjects.EObjectCondition |
E_FALSE, E_TRUE |
Fields inherited from class com.ibm.xtools.emf.query.conditions.Condition |
FALSE, TRUE |
Constructor Summary | |
protected |
OclCondition(String oclExpressionString,
org.eclipse.emf.ecore.EClass contextEObjectType,
IEStructuralFeatureValueGetter eStructuralFeatureValueGetter)
A constructor that takes 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 referenced by the
OCL expression. |
protected |
OclCondition(String oclExpressionString,
org.eclipse.emf.ecore.EClass contextEObjectType,
IEStructuralFeatureValueGetter eStructuralFeatureValueGetter,
PruneHandler pruneHandler)
A constructor that takes 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 referenced by the
OCL expression and a PruneHandler to consult for pruning.
|
Method Summary | |
Object |
evaluate(org.eclipse.emf.ecore.EObject eObject)
Evaluates the OCL condition. |
protected org.eclipse.emf.ecore.EClass |
getContextEObjectType()
Return the context EClass . |
IEStructuralFeatureValueGetter |
getEStructuralFeatureValueGetter()
A getter function that returns the IEStructuralFeatureValueGetter used by this
OclCondition |
protected Query |
getOclQuery()
A getter function to get the Query object generated by the
OCL interpreter for the initialization ocl expression string. |
org.eclipse.emf.ecore.EClassifier |
getResultType(org.eclipse.emf.ecore.EObject eObject)
Returns the type of the ocl expression. |
protected boolean |
isContextFree()
Answers whether or not this OclCondition is a context-free. |
boolean |
isSatisfied(org.eclipse.emf.ecore.EObject eObject)
Checks to see if the argument eObject is of a conformant type to be used by this OclCondition . |
void |
setEStructuralFeatureValueGetter(IEStructuralFeatureValueGetter eStructuralFeatureValueGetter)
A setter function that sets the IEStructuralFeatureValueGetter to be used by this
OclCondition |
Methods inherited from class com.ibm.xtools.emf.query.conditions.eobjects.EObjectCondition |
AND, EQUIVALENT, getPruneHandler, IMPLIES, isSatisfied, OR, shouldPrune, XOR |
Methods inherited from class com.ibm.xtools.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, org.eclipse.emf.ecore.EClass contextEObjectType, IEStructuralFeatureValueGetter eStructuralFeatureValueGetter)
EClass
representing the EObject
type which the OCL expression
uses as a context, an IEStructuralFeatureValueGetter
to
use to get values of EStructuralFeature
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 type of the EObject
being
evaluated by this OclCondition
. If it is null
, then this becomes a context-free OclCondition
.eStructuralFeatureValueGetter
- The IEStructuralFeatureValueGetter
to be used by this
OclCondition
to extract the value of the EStructuralFeatures of
interest. It serves as a layer of indirection to allow clients to intervene between
this condition object and the way it extracts the EStructuralFeatures' values so as to
allow for possible messaging of such values before subjecting them to evaluation by
the OCL interpreter.protected OclCondition(String oclExpressionString, org.eclipse.emf.ecore.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
referenced by the
OCL expression and a PruneHandler
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 type of the EObject
being
evaluated by this OclCondition
. If it is null
, then this becomes a context-free OclCondition
.eStructuralFeatureValueGetter
- The IEStructuralFeatureValueGetter
to be used by this
OclCondition
to extract the value of the EStructuralFeatures of
interest. It serves as a layer of indirection to allow clients to intervene between
this condition object and the way it extracts the EStructuralFeatures' values so as to
allow for possible messaging of such values before subjecting them to evaluation by
the OCL interpreter.pruneHandler
- The PruneHandler
to consult when pruningMethod Detail |
protected final Query getOclQuery()
Query
object generated by the
OCL interpreter for the initialization ocl expression string.
null
if it a
context-free and not been initialized by calling
isSatisfied/getOclQueryRecordpublic boolean isSatisfied(org.eclipse.emf.ecore.EObject eObject)
OclCondition
.
isSatisfied
in class EObjectCondition
eObject
- the EObject
to check
true
if the argument eObject satisfies
this EObjectCondition
EObjectCondition.isSatisfied(org.eclipse.emf.ecore.EObject)
public org.eclipse.emf.ecore.EClassifier getResultType(org.eclipse.emf.ecore.EObject eObject)
null
especially in the case of context-free
ocl-condition
eObject
- a context EObject
to pass in case of
context-free ocl-expression, otherwise, null
would be fine.
protected final boolean isContextFree()
OclCondition
is a context-free.
OclCondition
is a context-free onepublic final IEStructuralFeatureValueGetter getEStructuralFeatureValueGetter()
IEStructuralFeatureValueGetter
used by this
OclCondition
IEStructuralFeatureValueGetter
used by this OclCondition
public final void setEStructuralFeatureValueGetter(IEStructuralFeatureValueGetter eStructuralFeatureValueGetter)
IEStructuralFeatureValueGetter
to be used by this
OclCondition
eStructuralFeatureValueGetter
- The IEStructuralFeatureValueGetter
to setpublic Object evaluate(org.eclipse.emf.ecore.EObject eObject)
eObject
- Context for evaluation; can be null
protected final org.eclipse.emf.ecore.EClass getContextEObjectType()
EClass
. Could be null
if this is a context-free OCL condition
EClass
|
IBM Rational Software Modeler Release 6.0 |
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
Guidelines for using Eclipse APIs.
Copyright (c) IBM Corp. and others 2004. All rights reserved.