org.eclipse.emf.ocl.query
Interface QueryFactory

All Superinterfaces:
org.eclipse.emf.ecore.EFactory, org.eclipse.emf.ecore.EModelElement, org.eclipse.emf.ecore.EObject, org.eclipse.emf.common.notify.Notifier
All Known Implementing Classes:
QueryFactoryImpl

public interface QueryFactory
extends org.eclipse.emf.ecore.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 java.lang.String copyright
           
static QueryFactory eINSTANCE
          The singleton instance of the factory
 
Method Summary
 Query createQuery()
          Returns a new object of class 'Query'
 Query createQuery(OCLExpression expr)
          Creates a query from an OCLExpression (constraint or query).
 Query createQuery(java.lang.String expr, org.eclipse.emf.ecore.EClassifier context)
          Creates an OCL query from the specified OCL expression string, for the given OCL classifier context.
 QueryPackage getQueryPackage()
          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

public static final java.lang.String copyright

See Also:
Constant Field Values

eINSTANCE

public static final QueryFactory eINSTANCE
The singleton instance of the factory.

Method Detail

createQuery

public Query createQuery(java.lang.String expr,
                         org.eclipse.emf.ecore.EClassifier context)
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:
java.lang.IllegalArgumentException - if the OCL expression string is malformed or the context is null

createQuery

public Query createQuery()
Returns a new object of class 'Query'.

Returns:
a new object of class 'Query'.

createQuery

public Query createQuery(OCLExpression expr)
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:
java.lang.IllegalArgumentException - in case of well-formedness problems

getQueryPackage

public QueryPackage getQueryPackage()
Returns the package supported by this factory.

Returns:
the package supported by this factory.

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