IBM Rational Software Modeler
Release 6.0

com.ibm.xtools.emf.query.ocl
Interface IOclQueryHelper


public interface IOclQueryHelper

Utility classes to ease the generation of OCL queries over EMF models


Method Summary
 Set executeOclStatement(org.eclipse.emf.ecore.EObject self, org.eclipse.emf.ecore.EClass selfType, String oclStatement, org.eclipse.core.runtime.IProgressMonitor monitor)
          Executes the OCL statement specified by oclStatement using self as the context for the statement evaluation.
 Set executeQueryUsingOclFilter(org.eclipse.emf.ecore.EObject queryRoot, org.eclipse.emf.ecore.EClass selfType, String oclFilter, org.eclipse.core.runtime.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

executeQueryUsingOclFilter

public Set executeQueryUsingOclFilter(org.eclipse.emf.ecore.EObject queryRoot,
                                      org.eclipse.emf.ecore.EClass selfType,
                                      String oclFilter,
                                      org.eclipse.core.runtime.IProgressMonitor monitor)
                               throws InterruptedException,
                                      InvalidOclExpressionException
Executes a query using 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.

Parameters:
queryRoot - The root element to recusively apply the query to
selfType - 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 text
monitor - The monitor to use to display progress and/or cancel
Returns:
The collection of EObject produced by executing the OCL query
Throws:
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

executeOclStatement

public Set executeOclStatement(org.eclipse.emf.ecore.EObject self,
                               org.eclipse.emf.ecore.EClass selfType,
                               String oclStatement,
                               org.eclipse.core.runtime.IProgressMonitor monitor)
                        throws InterruptedException,
                               InvalidOclExpressionException
Executes the OCL statement specified by oclStatement using self as the context for the statement evaluation. The statement will only be applied to the self without recursing into children.

Parameters:
self - The context to use for the OCL statement evaluation
selfType - 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 statement
monitor - The monitor to use to display progress and/or cancel
Returns:
The set of Object produced by executing the OCL statement, could be EObject,String, null, anything
Throws:
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

IBM Rational Software Modeler
Release 6.0


Guidelines for using Eclipse APIs.

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