## org.eclipse.emf.ocl.parser
Interface EnvironmentFactory

All Known Implementing Classes:
  AbstractEnvironmentFactory, EcoreEnvironmentFactory

Deprecated. Use the `EnvironmentFactory` interface, instead.

    @Deprecated
    public interface EnvironmentFactory

A facotry for creating OCL parser `Environment`s. Clients of the OCL parser that wish to use OCL with their metamodels can provide the parser a factory that creates the suitable environments. The environment provides mappings from the client's metamodel to the Ecore metamodel, extended by UML constructs defined and/or used by the OCL language. Many of these mappings are optional (e.g., OclState, OclMessage, AssociationClass).

This interface is not intended to be implemented by clients "directly". It is highly recommended to extend the `AbstractEnvironmentFactory` or `EcoreEnvironmentFactory` class, instead.

Field Summary
`static EnvironmentFactory` `ECORE_INSTANCE` Deprecated. An instance that creates `Environment`s suitable for parsing OCL expressions on the Ecore metamodel.

Method Summary
`Environment` `createClassifierContext(Object context)` Deprecated. Creates an environment suitable for parsing OCL expressions on the specified `object`, which is some classifier in the client's metamodel or an instance thereof.
`Environment` `createEnvironment(Environment parent)` Deprecated. Creates a child environment of a specified `parent`, for definition of nested scopes.
`EvaluationEnvironment` `createEvaluationEnvironment()` Deprecated. Creates a new evaluation environment to track the values of variables in an OCL expression as it is evaluated.
`Map<EClass,Set<EObject>>` `createExtentMap(Object object)` Deprecated. Creates an extent map for invocation of `OclType.allInstances()` using the specified `object` as a context from which to find the scope in which OCL classifier extents are defined.
`Environment` `createOperationContext(Object context, Object operation)` Deprecated. Creates an environment suitable for parsing OCL expressions on the specified `operation`, which is some operation in the client's metamodel.
`Environment` `createPackageContext(List pathname)` Deprecated. Creates an environment suitable for parsing OCL expressions in the specified package context.
`Environment` `createPropertyContext(Object context, Object property)` Deprecated. Creates an environment suitable for parsing OCL expressions on the specified `property`, which is some property in the client's metamodel.

Field Detail

### ECORE_INSTANCE

    static final EnvironmentFactory ECORE_INSTANCE

  Deprecated.
  An instance that creates `Environment`s suitable for parsing OCL expressions on the Ecore metamodel. This factory expects classifiers to be instances of the `EClassifier` type and operations to be `EOperation`s.

Method Detail

### createPackageContext

    Environment createPackageContext(List pathname)

  Deprecated.
  Creates an environment suitable for parsing OCL expressions in the specified package context. This context will become a classifier context when the "self" variable is defined.

  Parameters:
    `pathname` - the qualified package name (the ::-separated parts)
  Returns:
    the environment
  See Also:
    `createClassifierContext(Object)`, `createOperationContext(Object, Object)`

### createClassifierContext

    Environment createClassifierContext(Object context)

  Deprecated.
  Creates an environment suitable for parsing OCL expressions on the specified `object`, which is some classifier in the client's metamodel or an instance thereof.

  The context may be either the specific model element or primitive value on which an OCL expression would be evaluated, or it may be an `EClassifier` of the target metamodel against which an OCL expression would be parsed. Note that, in the former case, the actual OCL context classifier (as an OCL type or `EClassifier`) will be inferred from the context object according to the nature of the environment factory.

  Parameters:
    `context` - the context object or classifier
  Returns:
    the environment
  See Also:
    `createOperationContext(Object, Object)`

### createOperationContext

    Environment createOperationContext(Object context,
                                       Object operation)

  Deprecated.
  Creates an environment suitable for parsing OCL expressions on the specified `operation`, which is some operation in the client's metamodel. Note that operation contexts can be defined in the context of any classifier to which that operation is applicable.

  Parameters:
    `context` - the context element or classifier. Either way, this indicates the classifier context in which to define the operation context (as in the `createClassifierContext(Object)` method)
    `operation` - an operation in the client's metamodel
  Returns:
    the environment
  See Also:
    `createClassifierContext(Object)`

### createPropertyContext

    Environment createPropertyContext(Object context,
                                      Object property)

  Deprecated.
  Creates an environment suitable for parsing OCL expressions on the specified `property`, which is some property in the client's metamodel. Note that property contexts can be defined in the context of any classifier in which that property is available.

  Parameters:
    `context` - the context element or classifier. Either way, this indicates the classifier context in which to define the property context (as in the `createClassifierContext(Object)` method)
    `property` - a property (structural feature) in the client's metamodel
  Returns:
    the environment
  See Also:
    `createClassifierContext(Object)`

### createEnvironment

    Environment createEnvironment(Environment parent)

  Deprecated.
  Creates a child environment of a specified `parent`, for definition of nested scopes.

  Parameters:
    `parent` - the parent environment
  Returns:
    the child environment

### createEvaluationEnvironment

    EvaluationEnvironment createEvaluationEnvironment()

  Deprecated.
  Creates a new evaluation environment to track the values of variables in an OCL expression as it is evaluated.

  Returns:
    a new evaluation environment

### createExtentMap

    Map<EClass,Set<EObject>> createExtentMap(Object object)

  Deprecated.
  Creates an extent map for invocation of `OclType.allInstances()` using the specified `object` as a context from which to find the scope in which OCL classifier extents are defined. This scope may be a resource, resource set, or some metamodel-specific scope. Note that in the case that the `object` is not an `EObject` but is, instead, some primitive type, then this may be difficult to determine.

  Clients are encourage to do what they can to optimize this mapping, by lazy initialization of key-value pairs, workspace indices, or whatever means is available. Note that the map will only ever be accessed by key (`Map.get(java.lang.Object)`); it will never be queried for all entries, all keys, all values, etc. This knowledge could help optimization.

  Parameters:
    `object` - a context object in the scope that covers the OCL classifier extents
  Returns:
    the extent map

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