|
org.eclipse.emf.query.ocl.conditions
Class BooleanOCLCondition<C,CLS,E>
java.lang.Object
org.eclipse.emf.query.conditions.Condition
org.eclipse.emf.query.conditions.eobjects.EObjectCondition
org.eclipse.emf.query.ocl.conditions.AbstractOCLCondition<C,CLS,E>
org.eclipse.emf.query.ocl.conditions.BooleanOCLCondition<C,CLS,E>
-
public class BooleanOCLCondition<C,CLS,E>
- extends
AbstractOCLCondition<C,CLS,E>
A specialized OCL condition class that is used to apply boolean-valued OCL
expressions to EObject s. These are commonly used to express
invariant constraints; they are not typically
evaluated but are usually
checked for
isSatisfied(EObject) .
Constructor Summary
|
BooleanOCLCondition
(
Environment<?,
C,?,?,?,?,?,?,?,?,
CLS,
E> env,
Query<
C,
CLS,
E> oclQuery,
C contextClassifier,
IEStructuralFeatureValueGetter eStructuralFeatureValueGetter,
PruneHandler pruneHandler)
Initializes a constraint condition with an OCL expression string, a context
classifier representing the type of "self" in the OCL expression, an
IEStructuralFeatureValueGetter to use to resolve the context
element for safe access to structural features, and a
PruneHandler.NEVER to consult for pruning the content tree. |
BooleanOCLCondition
(
Environment<?,
C,?,?,?,?,?,?,?,?,
CLS,
E> env,
Query<
C,
CLS,
E> oclQuery,
C contextClassifier,
PruneHandler pruneHandler)
Initializes a constraint condition with an OCL expression string, a context
classifier representing the type of "self" in the OCL expression, and a
PruneHandler.NEVER to consult for pruning the content tree. |
BooleanOCLCondition
(
Environment<?,
C,?,?,?,?,?,?,?,?,
CLS,
E> env,
String oclExpressionString,
C contextClassifier)
Initializes a constraint condition with an OCL expression string and a context
classifier representing the type of "self" in the OCL expression. |
BooleanOCLCondition
(
Environment<?,
C,?,?,?,?,?,?,?,?,
CLS,
E> env,
String oclExpressionString,
C contextClassifier,
IEStructuralFeatureValueGetter eStructuralFeatureValueGetter)
Initializes a constraint condition with an OCL expression string, a context
classifier representing the type of "self" in the OCL expression, and an
IEStructuralFeatureValueGetter to use to resolve the context
element for safe access to structural features. |
BooleanOCLCondition
(
Environment<?,
C,?,?,?,?,?,?,?,?,
CLS,
E> env,
String oclExpressionString,
C contextClassifier,
IEStructuralFeatureValueGetter eStructuralFeatureValueGetter,
PruneHandler pruneHandler)
Initializes a constraint condition with an OCL expression string, a context
classifier representing the type of "self" in the OCL expression, an
IEStructuralFeatureValueGetter to use to resolve the context
element for safe access to structural features, and a
PruneHandler.NEVER to consult for pruning the content tree. |
Method Summary
|
boolean
|
isSatisfied
(
EObject eObject)
Computes the boolean value resulting from evaluating the constraint
condition on the specified eObject . |
Methods inherited from class java.lang.
Object
|
clone,
equals,
finalize,
getClass,
hashCode,
notify,
notifyAll,
toString,
wait,
wait,
wait
|
BooleanOCLCondition
public BooleanOCLCondition(
Environment<?,
C,?,?,?,?,?,?,?,?,
CLS,
E> env,
String oclExpressionString,
C contextClassifier,
IEStructuralFeatureValueGetter eStructuralFeatureValueGetter)
throws
ParserException
- Initializes a constraint condition with an OCL expression string, a context
classifier representing the type of "self" in the OCL expression, and an
IEStructuralFeatureValueGetter to use to resolve the context
element for safe access to structural features.
It defaults to using PruneHandler.NEVER to consult
for pruning.
NOTE: if contextClassifier is null ,
then this becomes a context-free OCL condition.
-
Parameters:
-
env - an OCL environment in which to parse the expression.
Must not be null
-
oclExpressionString - The OCL expression to apply when evaluating this
OCLCondition
-
contextClassifier - The OCL context classifier.
Use null to create a context-free condition. -
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
structural features' values so
as to allow for manipulation of such values before subjecting
them to evaluation by the OCL interpreter.
-
Throws:
-
ParserException
- on failure to parse the specified expression in
the given classifier context, if this is not a context-free query
BooleanOCLCondition
public BooleanOCLCondition(
Environment<?,
C,?,?,?,?,?,?,?,?,
CLS,
E> env,
String oclExpressionString,
C contextClassifier)
throws
ParserException
- Initializes a constraint condition with an OCL expression string and a context
classifier representing the type of "self" in the OCL expression. A default
IEStructuralFeatureValueGetter is used to resolve the context
element for safe access to structural features.
It also defaults to using PruneHandler.NEVER to consult
for pruning.
NOTE: if contextClassifier is null ,
then this becomes a context-free OCL condition.
-
Parameters:
-
env - an OCL environment in which to parse the expression.
Must not be null
-
oclExpressionString - The OCL expression to apply when evaluating this
OCLCondition
-
contextClassifier - The OCL context classifier.
Use null to create a context-free condition.
-
Throws:
-
ParserException
- on failure to parse the specified expression in
the given classifier context, if this is not a context-free query
BooleanOCLCondition
public BooleanOCLCondition(
Environment<?,
C,?,?,?,?,?,?,?,?,
CLS,
E> env,
String oclExpressionString,
C contextClassifier,
IEStructuralFeatureValueGetter eStructuralFeatureValueGetter,
PruneHandler pruneHandler)
throws
ParserException
- Initializes a constraint condition with an OCL expression string, a context
classifier representing the type of "self" in the OCL expression, an
IEStructuralFeatureValueGetter to use to resolve the context
element for safe access to structural features, and a
PruneHandler.NEVER to consult for pruning the content tree.
NOTE: if contextClassifier is null ,
then this becomes a context-free OCL condition.
-
Parameters:
-
env - an OCL environment in which to parse the expression.
Must not be null
-
oclExpressionString - The OCL expression to apply when evaluating this
OCLCondition
-
contextClassifier - The OCL context classifier.
Use null to create a context-free condition. -
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
structural features' 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 pruning
-
Throws:
-
ParserException
- on failure to parse the specified expression in
the given classifier context, if this is not a context-free query
BooleanOCLCondition
public BooleanOCLCondition(
Environment<?,
C,?,?,?,?,?,?,?,?,
CLS,
E> env,
Query<
C,
CLS,
E> oclQuery,
C contextClassifier,
IEStructuralFeatureValueGetter eStructuralFeatureValueGetter,
PruneHandler pruneHandler)
- Initializes a constraint condition with an OCL expression string, a context
classifier representing the type of "self" in the OCL expression, an
IEStructuralFeatureValueGetter to use to resolve the context
element for safe access to structural features, and a
PruneHandler.NEVER to consult for pruning the content tree.
NOTE: if contextClassifier is null ,
then this becomes a context-free OCL condition.
-
Parameters:
-
env - the OCL environment in which the OCL query was parsed.
Must not be null
-
oclQuery - The OCL query to apply when evaluating this condition -
contextClassifier - 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
structural features' 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 pruning
-
Throws:
-
ParserException
- on failure to parse the specified expression in
the given classifier context, if this is not a context-free query
BooleanOCLCondition
public BooleanOCLCondition(
Environment<?,
C,?,?,?,?,?,?,?,?,
CLS,
E> env,
Query<
C,
CLS,
E> oclQuery,
C contextClassifier,
PruneHandler pruneHandler)
- Initializes a constraint condition with an OCL expression string, a context
classifier representing the type of "self" in the OCL expression, and a
PruneHandler.NEVER to consult for pruning the content tree.
NOTE: if contextClassifier is null ,
then this becomes a context-free OCL condition.
-
Parameters:
-
env - the OCL environment in which the OCL query was parsed.
Must not be null
-
oclQuery - The OCL query to apply when evaluating this condition -
contextClassifier - The OCL context classifier. Must not be null
-
pruneHandler - The PruneHandler to consult when pruning
-
Throws:
-
ParserException
- on failure to parse the specified expression in
the given classifier context, if this is not a context-free query
isSatisfied
public boolean isSatisfied(
EObject eObject)
- Computes the boolean value resulting from evaluating the constraint
condition on the specified
eObject .
-
-
Overrides:
-
isSatisfied
in class
AbstractOCLCondition<
C,
CLS,
E>
-
-
Parameters:
-
eObject - the EObject to check
-
Returns:
- boolean
true if the argument eObject satisfies
this EObjectCondition
-
See Also:
-
AbstractOCLCondition.getContextClassifier() ,
AbstractOCLCondition.isContextFree()
|
|