public class OCLQueryHandler extends Object implements IQueryHandler
query handler
that evaluates OCL query expressions.Modifier and Type | Class and Description |
---|---|
protected static class |
OCLQueryHandler.ContextParameter
An abstraction of the
classifier and/or obejct of an OCL query context parameter. |
static class |
OCLQueryHandler.Factory
Creates
OCLQueryHandler instances. |
Modifier and Type | Field and Description |
---|---|
static String |
IMPLICIT_ROOT_CLASS_PARAMETER
Query parameter indicating the
EClass to set as the implicit root class of the type
hierarchy. |
static String |
LANGUAGE_NAME |
static String |
LAZY_EXTENTS_PARAMETER |
Constructor and Description |
---|
OCLQueryHandler() |
Modifier and Type | Method and Description |
---|---|
protected void |
addEnvironmentVariable(org.eclipse.ocl.Environment<?,org.eclipse.emf.ecore.EClassifier,?,?,?,?,?,?,?,org.eclipse.ocl.ecore.Constraint,org.eclipse.emf.ecore.EClass,org.eclipse.emf.ecore.EObject> environment,
org.eclipse.ocl.expressions.Variable<org.eclipse.emf.ecore.EClassifier,?> variable) |
protected boolean |
addResult(Object result,
IQueryContext context,
CDOView view) |
protected CDOExtentMap |
createExtentMap(CDOView view,
CDOChangeSetData changeSetData,
IQueryContext context) |
protected org.eclipse.ocl.expressions.OCLExpression<org.eclipse.emf.ecore.EClassifier> |
createInitExpression(org.eclipse.ocl.types.OCLStandardLibrary<org.eclipse.emf.ecore.EClassifier> stdLib,
CDOPackageRegistry packageRegistry,
Object value) |
protected org.eclipse.ocl.OCL<?,org.eclipse.emf.ecore.EClassifier,?,?,?,?,?,?,?,org.eclipse.ocl.ecore.Constraint,org.eclipse.emf.ecore.EClass,org.eclipse.emf.ecore.EObject> |
createOCL(CDOView view,
CDOExtentMap extentMap) |
protected org.eclipse.ocl.Query<org.eclipse.emf.ecore.EClassifier,org.eclipse.emf.ecore.EClass,org.eclipse.emf.ecore.EObject> |
createQuery(CDOView view,
CDOQueryInfo info,
OCLQueryHandler.ContextParameter contextParameter,
org.eclipse.ocl.OCL<?,org.eclipse.emf.ecore.EClassifier,?,?,?,?,?,?,?,org.eclipse.ocl.ecore.Constraint,org.eclipse.emf.ecore.EClass,org.eclipse.emf.ecore.EObject> ocl) |
protected boolean |
createsLazyExtents() |
protected Object |
evaluate(org.eclipse.ocl.Query<org.eclipse.emf.ecore.EClassifier,org.eclipse.emf.ecore.EClass,org.eclipse.emf.ecore.EObject> query,
org.eclipse.emf.ecore.EObject object) |
void |
executeQuery(CDOQueryInfo info,
IQueryContext context)
Executes the
query represented by the specified query info by
passing the query results to the query execution engine represented by the
specified execution context . |
protected org.eclipse.emf.ecore.EClassifier |
getArbitraryContextClassifier(CDOPackageRegistry packageRegistry)
Deprecated.
As of 4.2 no longer supported.
|
protected OCLQueryHandler.ContextParameter |
getContextParameter(CDOQueryInfo info,
CDOView view) |
protected org.eclipse.emf.ecore.EClass |
getImplicitRootClass() |
protected CDORevision |
getRevision(org.eclipse.emf.ecore.EObject object,
CDOView view) |
protected void |
initEnvironment(org.eclipse.ocl.Environment<?,org.eclipse.emf.ecore.EClassifier,?,?,?,?,?,?,?,org.eclipse.ocl.ecore.Constraint,org.eclipse.emf.ecore.EClass,org.eclipse.emf.ecore.EObject> environment,
CDOPackageRegistry packageRegistry,
Map<String,Object> parameters) |
protected boolean |
isOCLQueryParameter(String name) |
static void |
prepareContainer(IManagedContainer container) |
protected boolean |
readParameter(Map<String,?> queryParameters,
String name,
boolean defaultValue) |
protected <T> T |
readParameter(Map<String,?> queryParameters,
String name,
Class<T> type,
T defaultValue) |
protected void |
readParameters(Map<String,?> queryParameters) |
protected void |
setOCLQueryParameters(Map<String,Object> parameters,
org.eclipse.ocl.Query<org.eclipse.emf.ecore.EClassifier,org.eclipse.emf.ecore.EClass,org.eclipse.emf.ecore.EObject> query) |
public static final String LANGUAGE_NAME
public static final String LAZY_EXTENTS_PARAMETER
public static final String IMPLICIT_ROOT_CLASS_PARAMETER
EClass
to set as the implicit root class of the type
hierarchy. The default is null
.public void executeQuery(CDOQueryInfo info, IQueryContext context)
IQueryHandler
query
represented by the specified query info
by
passing
the query results to the query execution engine represented by the
specified execution context
.executeQuery
in interface IQueryHandler
protected boolean addResult(Object result, IQueryContext context, CDOView view)
protected CDORevision getRevision(org.eclipse.emf.ecore.EObject object, CDOView view)
protected Object evaluate(org.eclipse.ocl.Query<org.eclipse.emf.ecore.EClassifier,org.eclipse.emf.ecore.EClass,org.eclipse.emf.ecore.EObject> query, org.eclipse.emf.ecore.EObject object)
protected CDOExtentMap createExtentMap(CDOView view, CDOChangeSetData changeSetData, IQueryContext context)
protected boolean createsLazyExtents()
protected org.eclipse.ocl.OCL<?,org.eclipse.emf.ecore.EClassifier,?,?,?,?,?,?,?,org.eclipse.ocl.ecore.Constraint,org.eclipse.emf.ecore.EClass,org.eclipse.emf.ecore.EObject> createOCL(CDOView view, CDOExtentMap extentMap)
protected org.eclipse.ocl.Query<org.eclipse.emf.ecore.EClassifier,org.eclipse.emf.ecore.EClass,org.eclipse.emf.ecore.EObject> createQuery(CDOView view, CDOQueryInfo info, OCLQueryHandler.ContextParameter contextParameter, org.eclipse.ocl.OCL<?,org.eclipse.emf.ecore.EClassifier,?,?,?,?,?,?,?,org.eclipse.ocl.ecore.Constraint,org.eclipse.emf.ecore.EClass,org.eclipse.emf.ecore.EObject> ocl) throws org.eclipse.ocl.ParserException, org.eclipse.emf.common.util.DiagnosticException
org.eclipse.ocl.ParserException
org.eclipse.emf.common.util.DiagnosticException
@Deprecated protected org.eclipse.emf.ecore.EClassifier getArbitraryContextClassifier(CDOPackageRegistry packageRegistry)
protected void initEnvironment(org.eclipse.ocl.Environment<?,org.eclipse.emf.ecore.EClassifier,?,?,?,?,?,?,?,org.eclipse.ocl.ecore.Constraint,org.eclipse.emf.ecore.EClass,org.eclipse.emf.ecore.EObject> environment, CDOPackageRegistry packageRegistry, Map<String,Object> parameters)
protected org.eclipse.emf.ecore.EClass getImplicitRootClass()
protected org.eclipse.ocl.expressions.OCLExpression<org.eclipse.emf.ecore.EClassifier> createInitExpression(org.eclipse.ocl.types.OCLStandardLibrary<org.eclipse.emf.ecore.EClassifier> stdLib, CDOPackageRegistry packageRegistry, Object value)
protected void addEnvironmentVariable(org.eclipse.ocl.Environment<?,org.eclipse.emf.ecore.EClassifier,?,?,?,?,?,?,?,org.eclipse.ocl.ecore.Constraint,org.eclipse.emf.ecore.EClass,org.eclipse.emf.ecore.EObject> environment, org.eclipse.ocl.expressions.Variable<org.eclipse.emf.ecore.EClassifier,?> variable)
protected OCLQueryHandler.ContextParameter getContextParameter(CDOQueryInfo info, CDOView view)
protected boolean readParameter(Map<String,?> queryParameters, String name, boolean defaultValue)
protected <T> T readParameter(Map<String,?> queryParameters, String name, Class<T> type, T defaultValue)
protected void setOCLQueryParameters(Map<String,Object> parameters, org.eclipse.ocl.Query<org.eclipse.emf.ecore.EClassifier,org.eclipse.emf.ecore.EClass,org.eclipse.emf.ecore.EObject> query)
protected boolean isOCLQueryParameter(String name)
public static void prepareContainer(IManagedContainer container)
Copyright (c) 2011-2014 Eike Stepper (Berlin, Germany) and others.