org.eclipse.ease.modules

## Interface IEnvironment

All Known Implementing Classes:
  AbstractEnvironment, EnvironmentModule, NativeEnvironment

    public interface IEnvironment

### Method Summary

All Methods Instance Methods Abstract Methods
`void` `addModuleListener(IModuleListener listener)`
`Object` `getModule(String name)`
`<T,U extends Class<T>> T` `getModule(U clazz)`
`List<Object>` `getModules()` Retrieve a list of loaded modules.
`IScriptEngine` `getScriptEngine()`
`Object` `loadModule(String moduleIdentifier)` Load a module.
`void` `print(Object text, boolean lineFeed)` Print to standard output.
`void` `removeModuleListener(IModuleListener listener)`
`void` `wrap(Object toBeWrapped)` Wrap a java instance.

### Method Detail

#### getScriptEngine

    IScriptEngine getScriptEngine()

#### getModule

    Object getModule(String name)

#### getModule

    <T,U extends Class<T>> T getModule(U clazz)

#### getModules

    List<Object> getModules()

Retrieve a list of loaded modules. The returned list is read only.

Returns:
  list of modules (might be empty)

#### print

    void print(Object text,
               boolean lineFeed)

Print to standard output.

Parameters:
  `text` - message to write
  `lineFeed` - `true` to add a line feed after the text

#### addModuleListener

    void addModuleListener(IModuleListener listener)

#### removeModuleListener

    void removeModuleListener(IModuleListener listener)

#### loadModule

    Object loadModule(String moduleIdentifier)

Load a module. Loading a module generally enhances the JavaScript environment with new functions and variables. If a module was already loaded before, it gets refreshed and moved to the top of the module stack. When a module is loaded, all its dependencies are loaded too. So loading one module might change the whole module stack.

Parameters:
  `name` - name of module to load
Returns:
  loaded module instance

#### wrap

    void wrap(Object toBeWrapped)

Wrap a java instance. Will create accessors in the target language for methods and constants defined by the java instance toBeWrapped. If the instance contains annotations of type `WrapToScript` only these will be wrapped. If no annotation can be found, all public methods/constants will be wrapped. As some target languages might not support method overloading this might result in some methods not wrapped correctly.

Parameters:
  `toBeWrapped` - instance to be wrapped