## org.eclipse.ocl
Interface Environment.Registry

Enclosing interface:
  Environment<PK,C,O,P,EL,PM,S,COA,SSA,CT,CLS,E>

    public static interface Environment.Registry

A registry of environments. The registry may be consulted to find a default environment suitable for the introspection of a model element. These environments will never be used for the definition of constraints or variables.

This registry may be populated at run-time or, in an Eclipse environment, statically on the `org.eclipse.ocl.environments` extension point.

Field Summary
`static Environment.Registry` `INSTANCE` The shared registry instance.

Method Summary
`void` `deregisterEnvironment(Environment<?,?,?,?,?,?,?,?,?,?,?,?> environment)` Removes the specified environment from the registry.

`

`<PK,C,O,P,EL,PM,S,COA,SSA,CT,CLS,E> Environment<PK,C,O,P,EL,PM,S,COA,SSA,CT,CLS,E>`

`

`getEnvironmentFor(Object abstractSyntaxElement)`
Obtains a suitable environment for introspection of the specified model element, type (such as a collection type), or other abstract syntax element (e.g., a variable).

`

`<PK,C,O,P,EL,PM,S,COA,SSA,CT,CLS,E> Environment<PK,C,O,P,EL,PM,S,COA,SSA,CT,CLS,E>`

`

`getEnvironmentFor(OCLExpression<C> expression)`
Obtains a suitable environment for introspection of the specified expression.

`void` `registerEnvironment(Environment<?,?,?,?,?,?,?,?,?,?,?,?> environment)` Adds the specified environment to the registry.

Field Detail

### INSTANCE

    static final Environment.Registry INSTANCE

  The shared registry instance.

Method Detail

### getEnvironmentFor

    <PK,C,O,P,EL,PM,S,COA,SSA,CT,CLS,E> Environment<PK,C,O,P,EL,PM,S,COA,SSA,CT,CLS,E> getEnvironmentFor(OCLExpression<C> expression)

  Obtains a suitable environment for introspection of the specified expression.

  Parameters:
    `expression` - a parsed OCL expression
  Returns:
    the matching registered environment, or `null` if none is available

### getEnvironmentFor

    <PK,C,O,P,EL,PM,S,COA,SSA,CT,CLS,E> Environment<PK,C,O,P,EL,PM,S,COA,SSA,CT,CLS,E> getEnvironmentFor(Object abstractSyntaxElement)

  Obtains a suitable environment for introspection of the specified model element, type (such as a collection type), or other abstract syntax element (e.g., a variable).

  Parameters:
    `abstractSyntaxElement` - an element in or referenced by the AST of of an OCL constraint
  Returns:
    the matching registered environment, or `null` if none is available

### registerEnvironment

    void registerEnvironment(Environment<?,?,?,?,?,?,?,?,?,?,?,?> environment)

  Adds the specified environment to the registry.

  Parameters:
    `environment` - an environment to register

### deregisterEnvironment

    void deregisterEnvironment(Environment<?,?,?,?,?,?,?,?,?,?,?,?> environment)

  Removes the specified environment from the registry.

  Parameters:
    `environment` - the environment to deregister

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