org.eclipse.ease.service

## Class ScriptService

- java.lang.Object
- - org.eclipse.ease.service.ScriptService

All Implemented Interfaces:
  EventListener, IScriptService, org.osgi.framework.BundleListener

    public class ScriptService
    extends Object
    implements IScriptService, org.osgi.framework.BundleListener

### Field Summary

### Fields inherited from interface org.eclipse.ease.service.IScriptService

`TRACE_SCRIPT_SERVICE`

### Method Summary

All Methods Static Methods Instance Methods Concrete Methods
`void` `bundleChanged(org.osgi.framework.BundleEvent event)`
`Map<String,ModuleCategoryDefinition>` `getAvailableModuleCategories()` Get a map of available module categories.
`Map<String,ModuleDefinition>` `getAvailableModules()` Get a map of available modules.
`Map<String,ScriptType>` `getAvailableScriptTypes()` Get a map of available script tpye.
`static ICodeFactory` `getCodeFactory(IScriptEngine engine)` Get the default `ICodeFactory` for a given script engine.
`static ICodeParser` `getCodeParser(IScriptEngine engine)` Get the default `ICodeParser` for a given script engine.
`EngineDescription` `getEngine(String scriptType)` Get default engine for a given script type.
`EngineDescription` `getEngineByID(String engineID)` Get a dedicated engine description.
`Collection<EngineDescription>` `getEngines()` Get available engine descriptions.
`List<EngineDescription>` `getEngines(String scriptType)` Get available engine descriptions for a given script type.
`static ScriptService` `getInstance()`
`Collection<IScriptEngineLaunchExtension>` `getLaunchExtensions(String engineID)` Get Launch extensions for a dedicated script engine.
`ModuleDefinition` `getModuleDefinition(String moduleId)` Get the definition of the module with given ID.
`ScriptType` `getScriptType(String location)` Get the script type for a given resource location.
`static IScriptService` `getService()`

### Methods inherited from class java.lang.Object

`equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

### Method Detail

#### getService

    public static IScriptService getService()

#### getInstance

    public static ScriptService getInstance()

#### getEngineByID

    public EngineDescription getEngineByID(String engineID)

Description copied from interface: `IScriptService`
Get a dedicated engine description. Allows to get an engine description for a dedicated engine identifier.

Specified by:
  `getEngineByID` in interface `IScriptService`
Parameters:
  `engineID` - engine identifier
Returns:
  script engine description or `null`

#### getAvailableModules

    public Map<String,ModuleDefinition> getAvailableModules()

Description copied from interface: `IScriptService`
Get a map of available modules. Keys contain the full module name, values contain its descriptor.

Specified by:
  `getAvailableModules` in interface `IScriptService`
Returns:
  available modules or empty map

#### getEngines

    public Collection<EngineDescription> getEngines()

Description copied from interface: `IScriptService`
Get available engine descriptions.

Specified by:
  `getEngines` in interface `IScriptService`
Returns:
  available descriptions or empty collection

#### getEngines

    public List<EngineDescription> getEngines(String scriptType)

Description copied from interface: `IScriptService`
Get available engine descriptions for a given script type. The resulting list is sorted by priority. Index 0 contains the engine with the highest priority.

Specified by:
  `getEngines` in interface `IScriptService`
Parameters:
  `scriptType` - type of script
Returns:
  available descriptions or empty collection

#### getLaunchExtensions

    public Collection<IScriptEngineLaunchExtension> getLaunchExtensions(String engineID)

Description copied from interface: `IScriptService`
Get Launch extensions for a dedicated script engine.

Specified by:
  `getLaunchExtensions` in interface `IScriptService`
Parameters:
  `engineID` - engine identifier
Returns:
  launch extensions or empty collection

#### getAvailableScriptTypes

    public Map<String,ScriptType> getAvailableScriptTypes()

Description copied from interface: `IScriptService`
Get a map of available script tpye. Keys contain the type name, values contain its descriptor.

Specified by:
  `getAvailableScriptTypes` in interface `IScriptService`
Returns:
  available script types or empty map

#### getScriptType

    public ScriptType getScriptType(String location)

Description copied from interface: `IScriptService`
Get the script type for a given resource location.

Specified by:
  `getScriptType` in interface `IScriptService`
Parameters:
  `location` - resource location
Returns:
  script type associated with file extension or `null`

#### getEngine

    public EngineDescription getEngine(String scriptType)

Description copied from interface: `IScriptService`
Get default engine for a given script type. While there might exist multiple engines, the returned one has the highest priority.

Specified by:
  `getEngine` in interface `IScriptService`
Parameters:
  `scriptType` - type of script
Returns:
  engine description or `null`

#### getAvailableModuleCategories

    public Map<String,ModuleCategoryDefinition> getAvailableModuleCategories()

Description copied from interface: `IScriptService`
Get a map of available module categories. Keys contain the category id, values contain its descriptor.

Specified by:
  `getAvailableModuleCategories` in interface `IScriptService`
Returns:
  available modules or empty map

#### getModuleDefinition

    public ModuleDefinition getModuleDefinition(String moduleId)

Description copied from interface: `IScriptService`
Get the definition of the module with given ID.

Specified by:
  `getModuleDefinition` in interface `IScriptService`
Parameters:
  `moduleId` - id to look for
Returns:
  module definition

#### getCodeFactory

    public static ICodeFactory getCodeFactory(IScriptEngine engine)

Get the default `ICodeFactory` for a given script engine.

Parameters:
  `engine` - script engine to look up
Returns:
  code factory or `null`

#### getCodeParser

    public static ICodeParser getCodeParser(IScriptEngine engine)

Get the default `ICodeParser` for a given script engine.

Parameters:
  `engine` - script engine to look up
Returns:
  code factory or `null`

#### bundleChanged

    public void bundleChanged(org.osgi.framework.BundleEvent event)

Specified by:
  `bundleChanged` in interface `org.osgi.framework.BundleListener`