## org.eclipse.emf.ocl.query
Interface QueryFactory

All Superinterfaces:
  EFactory, EModelElement, EObject, Notifier

All Known Implementing Classes:
  QueryFactoryImpl

Deprecated. Use the `OCL` class to create `Query` instances, instead.

    @Deprecated
    public interface QueryFactory

extends EFactory

The Factory for the model. It provides a create method for each non-abstract class of the model.

See Also:
  `QueryPackage`

Field Summary
`static String` `copyright` Deprecated.
`static QueryFactory` `eINSTANCE` Deprecated. The singleton instance of the factory

Method Summary
`Query` `createQuery()` Deprecated. Returns a new object of class 'Query'
`Query` `createQuery(OCLExpression expr)` Deprecated. Creates a query from an `OCLExpression` (constraint or query).
`Query` `createQuery(String expr, EClassifier context)` Deprecated. Creates an OCL query from the specified OCL expression string, for the given OCL classifier context.
`QueryPackage` `getQueryPackage()` Deprecated. Returns the package supported by this factory

Methods inherited from interface org.eclipse.emf.ecore.EFactory
`convertToString, create, createFromString, getEPackage, setEPackage`

Methods inherited from interface org.eclipse.emf.ecore.EModelElement
`getEAnnotation, getEAnnotations`

Methods inherited from interface org.eclipse.emf.ecore.EObject
`eAllContents, eClass, eContainer, eContainingFeature, eContainmentFeature, eContents, eCrossReferences, eGet, eGet, eIsProxy, eIsSet, eResource, eSet, eUnset`

Methods inherited from interface org.eclipse.emf.common.notify.Notifier
`eAdapters, eDeliver, eNotify, eSetDeliver`

Field Detail

### copyright

    static final String copyright

  Deprecated.

  See Also:
    Constant Field Values

### eINSTANCE

    static final QueryFactory eINSTANCE

  Deprecated.
  The singleton instance of the factory.

Method Detail

### createQuery

    Query createQuery(String expr,
                      EClassifier context)

  Deprecated.
  Creates an OCL query from the specified OCL expression string, for the given OCL classifier context.

  This method offers the convenience of creating the package and context declaration and other boilerplate components of the query on the caller's behalf; the specified expression must be only the bare expression without even the `inv:` keyword. e.g.,

           self.color <> Color::red

  instead of:

           package com::examples::fruit
           context Pomegranate
           inv: self.color <> Color::red
           endpackage

  Parameters:
    `expr` - the bare OCL expression text
    `context` - the OCL classifier context
  Returns:
    the compiled OCL query object
  Throws:
    `IllegalArgumentException` - if the OCL expression string is malformed or the `context` is `null`

### createQuery

    Query createQuery()

  Deprecated.
  Returns a new object of class 'Query'.

  Returns:
    a new object of class 'Query'.

### createQuery

    Query createQuery(OCLExpression expr)

  Deprecated.
  Creates a query from an `OCLExpression` (constraint or query). The query is validated according to OCL well-formedness rules.

  Parameters:
    `expr` - the ocl expression
  Returns:
    the new query instance, if the OCL expression is valid
  Throws:
    `IllegalArgumentException` - in case of well-formedness problems

### getQueryPackage

    QueryPackage getQueryPackage()

  Deprecated.
  Returns the package supported by this factory.

  Returns:
    the package supported by this factory.

Copyright 2002, 2007 IBM Corporation and others. All Rights Reserved.