org.eclipse.ocl.examples.pivot.utilities
Class EnvironmentRegistryImpl

java.lang.Object
  extended by org.eclipse.ocl.examples.pivot.utilities.EnvironmentRegistryImpl
All Implemented Interfaces:
Environment.Registry

public class EnvironmentRegistryImpl
extends java.lang.Object
implements Environment.Registry

Implementation of the environment registry.

Author:
cdamus

Field Summary
 
Fields inherited from interface org.eclipse.ocl.examples.pivot.Environment.Registry
INSTANCE
 
Constructor Summary
EnvironmentRegistryImpl()
           
 
Method Summary
 void deregisterEnvironment(Environment environment)
          Removes the specified environment from the registry.
 Environment getEnvironmentFor(java.lang.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).
 Environment getEnvironmentFor(OCLExpression expression)
          Obtains a suitable environment for introspection of the specified expression.
 void registerEnvironment(Environment environment)
          Adds the specified environment to the registry.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

EnvironmentRegistryImpl

public EnvironmentRegistryImpl()
Method Detail

getEnvironmentFor

@Nullable
public Environment getEnvironmentFor(@NonNull
                                              OCLExpression expression)
Description copied from interface: Environment.Registry
Obtains a suitable environment for introspection of the specified expression.

Specified by:
getEnvironmentFor in interface Environment.Registry
Parameters:
expression - a parsed OCL expression
Returns:
the matching registered environment, or null if none is available

getEnvironmentFor

@Nullable
public Environment getEnvironmentFor(@NonNull
                                              java.lang.Object abstractSyntaxElement)
Description copied from interface: Environment.Registry
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).

Specified by:
getEnvironmentFor in interface Environment.Registry
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

public void registerEnvironment(@NonNull
                                Environment environment)
Description copied from interface: Environment.Registry
Adds the specified environment to the registry.

Specified by:
registerEnvironment in interface Environment.Registry
Parameters:
environment - an environment to register

deregisterEnvironment

public void deregisterEnvironment(@NonNull
                                  Environment environment)
Description copied from interface: Environment.Registry
Removes the specified environment from the registry.

Specified by:
deregisterEnvironment in interface Environment.Registry
Parameters:
environment - the environment to deregister