IBM Rational Software Modeler
Release 6.0

com.ibm.xtools.emf.query.ocl.conditions
Class OclConstraintCondition

java.lang.Object
  extended bycom.ibm.xtools.emf.query.conditions.Condition
      extended bycom.ibm.xtools.emf.query.conditions.eobjects.EObjectCondition
          extended bycom.ibm.xtools.emf.query.ocl.conditions.OclCondition
              extended bycom.ibm.xtools.emf.query.ocl.conditions.OclConstraintCondition

public class OclConstraintCondition
extends OclCondition

A subclass of OCL condition class that is used to apply boolean based OCL expression on EObjects.


Field Summary
static OclConstraintCondition NULL_CONDITION
          A simple constant class that represents a null OclConstraintCondition which basically is always satisfied.
 
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
OclConstraintCondition(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.
OclConstraintCondition(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
 boolean isSatisfied(org.eclipse.emf.ecore.EObject eObject)
          Returns the boolean value as a result of evaluating the ocl expression on the argument eObject.
 
Methods inherited from class com.ibm.xtools.emf.query.ocl.conditions.OclCondition
evaluate, getContextEObjectType, getEStructuralFeatureValueGetter, getOclQuery, getResultType, isContextFree, setEStructuralFeatureValueGetter
 
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
 

Field Detail

NULL_CONDITION

public static final OclConstraintCondition NULL_CONDITION
A simple constant class that represents a null OclConstraintCondition which basically is always satisfied.

Constructor Detail

OclConstraintCondition

public OclConstraintCondition(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. It defaults to using PruneHandler.NEVER to consult for pruning. NOTE: if contextEObjectType is null, then this becomes a context-free ocl-condition

Parameters:
oclExpressionString - The OCL expression to apply when evaluating this OclConstraintCondition
contextEObjectType - The EClass representing the type of the EObject being evaluated by this OclConstraintCondition. If it is null, then this becomes a context-free OclConstraintCondition.
eStructuralFeatureValueGetter - The IEStructuralFeatureValueGetter to be used by this OclConstraintCondition 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.

OclConstraintCondition

public OclConstraintCondition(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. NOTE: if contextEObjectType is null, then this becomes a context-free ocl-condition

Parameters:
oclExpressionString - The OCL expression to apply when evaluating this OclConstraintCondition
contextEObjectType - The EClass representing the type of the EObject being evaluated by this OclConstraintCondition. If it is null, then this becomes a context-free OclConstraintCondition.
eStructuralFeatureValueGetter - The IEStructuralFeatureValueGetter to be used by this OclConstraintCondition 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 pruning
Method Detail

isSatisfied

public boolean isSatisfied(org.eclipse.emf.ecore.EObject eObject)
Returns the boolean value as a result of evaluating the ocl expression on the argument eObject.

Overrides:
isSatisfied in class OclCondition
See Also:
EObjectCondition.isSatisfied(org.eclipse.emf.ecore.EObject)

IBM Rational Software Modeler
Release 6.0


Guidelines for using Eclipse APIs.

Copyright (c) IBM Corp. and others 2004. All rights reserved.