|
IBM Rational Software Modeler Release 6.0 |
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
Utility classes to ease the generation of OCL queries over EMF models
Method Summary | |
Object |
evaluate(EObject self,
String oclExpression,
IProgressMonitor monitor)
Evaluates the OCL expression specified by oclExpression using
self as the context for the expression evaluation. |
Set |
executeOclStatement(EObject self,
EClass selfType,
String oclStatement,
IProgressMonitor monitor)
Deprecated. Use the evaluate(EObject, String, IProgressMonitor)
method, instead, because it preserves the ordering of
collection-valued OCL expressions in case the expression is of an
ordered collection (list) type |
Set |
executeQueryUsingOclFilter(EObject queryRoot,
EClass selfType,
String oclFilter,
IProgressMonitor monitor)
Executes a query using queryRoot as the root of the
subtree where to perform the search and an OCL filter specified by
oclFilter . |
Method Detail |
public Set executeQueryUsingOclFilter(EObject queryRoot, EClass selfType, String oclFilter, IProgressMonitor monitor) throws InterruptedException, InvalidOclExpressionException
queryRoot
as the root of the
subtree where to perform the search and an OCL filter specified by
oclFilter
.EObject
s satisfying the OCL
condition are returned.
queryRoot
- The root element to recusively apply the query toselfType
- Type of the "self" element specified in the query text. Pass
null to specify a context-free OCL query (no syntactic
validation of the OCL expression can be performed in this
case)oclFilter
- The string containing the OCL query textmonitor
- The monitor to use to display progress and/or cancel
EObject
produced by executing
the OCL query
InterruptedException
- The query operation was interrupted
InvalidOclExpressionException
- The specified OCL expression is invalid
IllegalArgumentException
- oclFilter
is an empty string
NullPointerException
- One of the passed parameters was null
public Set executeOclStatement(EObject self, EClass selfType, String oclStatement, IProgressMonitor monitor) throws InterruptedException, InvalidOclExpressionException
evaluate(EObject, String, IProgressMonitor)
method, instead, because it preserves the ordering of
collection-valued OCL expressions in case the expression is of an
ordered collection (list) type
oclStatement
using
self
as the context for the statement evaluation. The
statement will only be applied to the self without recursing into
children.
self
- The context to use for the OCL statement evaluationselfType
- Type of the self
. Pass null to specify a
context-free OCL statement (no syntactic validation of the OCL
statement can be performed in this case)oclStatement
- The string containing the OCL statementmonitor
- The monitor to use to display progress and/or cancel
Object
produced by executing the OCL
statement, could be EObject
,String
,
null
, anything
InterruptedException
- The query operation was interrupted
InvalidOclExpressionException
- The specified OCL statement is invalid
IllegalArgumentException
- oclStatement
is an empty string
NullPointerException
- One of the passed parameters was null
public Object evaluate(EObject self, String oclExpression, IProgressMonitor monitor) throws InterruptedException, InvalidOclExpressionException
oclExpression
using
self
as the context for the expression evaluation. The
expression will only be evaluated on self
without
recursing into children.
self
- The context to use for the OCL expression evaluationoclExpression
- The string specifying the OCL expressionmonitor
- The monitor to use to display progress and/or cancel
null
if the expression's value is null or if it
is a statement that has no result typeEObject
if the value is a model elementObject
if the value is some primitive value or
other kind of Java object such as a string or a dateCollection
of some kind if the value is some kind of
OCL collection. This may be an ordered collection
(List
), a set (Set
), or a bag
(Collection
)InterruptedException
- The expression evaluation was interrupted
InvalidOclExpressionException
- The specified OCL expression is invalid
IllegalArgumentException
- oclExpression/code> is an empty string
NullPointerException
- One of the arguments was null
|
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.