org.eclipse.emf.cdo.server.ocl

## Class OCLQueryHandler

- java.lang.Object
- - org.eclipse.emf.cdo.server.ocl.OCLQueryHandler

- All Implemented Interfaces:
    IQueryHandler

      public class OCLQueryHandler
      extends Object
      implements IQueryHandler

  A `query handler` that evaluates OCL query expressions.
  Author:
    Eike Stepper

- - ### Nested Class Summary

    Nested Classes
    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.

  - ### Field Summary

    Fields
    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 Summary

    Constructors
    Constructor and Description
    `OCLQueryHandler()`

  - ### Method Summary

    All Methods Static Methods Instance Methods Concrete Methods Deprecated Methods
    Modifier and Type | Method and Description
    --- | ---
    `protected void` | `addEnvironmentVariable(org.eclipse.ocl.Environment<?,EClassifier,?,?,?,?,?,?,?,org.eclipse.ocl.ecore.Constraint,EClass,EObject> environment, org.eclipse.ocl.expressions.Variable<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<EClassifier>` | `createInitExpression(org.eclipse.ocl.types.OCLStandardLibrary<EClassifier> stdLib, CDOPackageRegistry packageRegistry, Object value)`
    `protected org.eclipse.ocl.OCL<?,EClassifier,?,?,?,?,?,?,?,org.eclipse.ocl.ecore.Constraint,EClass,EObject>` | `createOCL(CDOView view, CDOExtentMap extentMap)`
    `protected org.eclipse.ocl.Query<EClassifier,EClass,EObject>` | `createQuery(CDOView view, CDOQueryInfo info, OCLQueryHandler.ContextParameter contextParameter, org.eclipse.ocl.OCL<?,EClassifier,?,?,?,?,?,?,?,org.eclipse.ocl.ecore.Constraint,EClass,EObject> ocl)`
    `protected boolean` | `createsLazyExtents()`
    `protected Object` | `evaluate(org.eclipse.ocl.Query<EClassifier,EClass,EObject> query, 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 EClassifier` | `getArbitraryContextClassifier(CDOPackageRegistry packageRegistry)` Deprecated. As of 4.2 no longer supported.
    `protected OCLQueryHandler.ContextParameter` | `getContextParameter(CDOQueryInfo info, CDOView view)`
    `protected EClass` | `getImplicitRootClass()`
    `protected CDORevision` | `getRevision(EObject object, CDOView view)`
    `protected void` | `initEnvironment(org.eclipse.ocl.Environment<?,EClassifier,?,?,?,?,?,?,?,org.eclipse.ocl.ecore.Constraint,EClass,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<EClassifier,EClass,EObject> query)`

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Field Detail

    - #### LANGUAGE_NAME

          public static final String LANGUAGE_NAME

      See Also:
        Constant Field Values

    - #### LAZY_EXTENTS_PARAMETER

          public static final String LAZY_EXTENTS_PARAMETER

      Since:
        4.1
      See Also:
        Constant Field Values

    - #### IMPLICIT_ROOT_CLASS_PARAMETER

          public static final String IMPLICIT_ROOT_CLASS_PARAMETER

      Query parameter indicating the `EClass` to set as the implicit root class of the type hierarchy. The default is `null`.
      Since:
        4.2
      See Also:
        Constant Field Values

  - ### Constructor Detail

    - #### OCLQueryHandler

          public OCLQueryHandler()

  - ### Method Detail

    - #### executeQuery

          public void executeQuery(CDOQueryInfo info,
                                   IQueryContext context)

      Description copied from interface: `IQueryHandler`
      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`.
      Specified by:
        `executeQuery` in interface `IQueryHandler`

    - #### addResult

          protected boolean addResult(Object result,
                                      IQueryContext context,
                                      CDOView view)

    - #### getRevision

          protected CDORevision getRevision(EObject object,
                                            CDOView view)

    - #### evaluate

          protected Object evaluate(org.eclipse.ocl.Query<EClassifier,EClass,EObject> query,
                                    EObject object)

    - #### createExtentMap

          protected CDOExtentMap createExtentMap(CDOView view,
                                                 CDOChangeSetData changeSetData,
                                                 IQueryContext context)

    - #### createsLazyExtents

          protected boolean createsLazyExtents()

    - #### createOCL

          protected org.eclipse.ocl.OCL<?,EClassifier,?,?,?,?,?,?,?,org.eclipse.ocl.ecore.Constraint,EClass,EObject> createOCL(CDOView view,
                                                                                                                               CDOExtentMap extentMap)

      Since:
        4.2

    - #### createQuery

          protected org.eclipse.ocl.Query<EClassifier,EClass,EObject> createQuery(CDOView view,
                                                                                  CDOQueryInfo info,
                                                                                  OCLQueryHandler.ContextParameter contextParameter,
                                                                                  org.eclipse.ocl.OCL<?,EClassifier,?,?,?,?,?,?,?,org.eclipse.ocl.ecore.Constraint,EClass,EObject> ocl)
                                                                           throws org.eclipse.ocl.ParserException,
                                                                                  DiagnosticException

      Throws:
        `org.eclipse.ocl.ParserException`
        `DiagnosticException`
      Since:
        4.2

    - #### getArbitraryContextClassifier

          @Deprecated
          protected EClassifier getArbitraryContextClassifier(CDOPackageRegistry packageRegistry)

      Deprecated. As of 4.2 no longer supported.

    - #### initEnvironment

          protected void initEnvironment(org.eclipse.ocl.Environment<?,EClassifier,?,?,?,?,?,?,?,org.eclipse.ocl.ecore.Constraint,EClass,EObject> environment,
                                         CDOPackageRegistry packageRegistry,
                                         Map<String,Object> parameters)

    - #### getImplicitRootClass

          protected EClass getImplicitRootClass()

      Since:
        4.2

    - #### createInitExpression

          protected org.eclipse.ocl.expressions.OCLExpression<EClassifier> createInitExpression(org.eclipse.ocl.types.OCLStandardLibrary<EClassifier> stdLib,
                                                                                                CDOPackageRegistry packageRegistry,
                                                                                                Object value)

    - #### addEnvironmentVariable

          protected void addEnvironmentVariable(org.eclipse.ocl.Environment<?,EClassifier,?,?,?,?,?,?,?,org.eclipse.ocl.ecore.Constraint,EClass,EObject> environment,
                                                org.eclipse.ocl.expressions.Variable<EClassifier,?> variable)

    - #### getContextParameter

          protected OCLQueryHandler.ContextParameter getContextParameter(CDOQueryInfo info,
                                                                         CDOView view)

      Since:
        4.2

    - #### readParameters

          protected void readParameters(Map<String,?> queryParameters)

      Since:
        4.2

    - #### readParameter

          protected boolean readParameter(Map<String,?> queryParameters,
                                          String name,
                                          boolean defaultValue)

      Since:
        4.2

    - #### readParameter

          protected <T> T readParameter(Map<String,?> queryParameters,
                                        String name,
                                        Class<T> type,
                                        T defaultValue)

      Since:
        4.2

    - #### setOCLQueryParameters

          protected void setOCLQueryParameters(Map<String,Object> parameters,
                                               org.eclipse.ocl.Query<EClassifier,EClass,EObject> query)

      Since:
        4.2

    - #### isOCLQueryParameter

          protected boolean isOCLQueryParameter(String name)

      Since:
        4.2

    - #### prepareContainer

          public static void prepareContainer(IManagedContainer container)

Copyright (c) 2014 Eike Stepper (Berlin, Germany) and others.
All rights reserved. This program and the accompanying materials are made available under the terms of the Eclipse Public License v1.0 which accompanies this distribution, and is available at http://www.eclipse.org/legal/epl-v10.html