org.codehaus.groovy.jsr223

## Class GroovyScriptEngineFactory

- java.lang.Object
- - org.codehaus.groovy.jsr223.GroovyScriptEngineFactory

- All Implemented Interfaces:
    ScriptEngineFactory

      public class GroovyScriptEngineFactory
      extends Object
      implements ScriptEngineFactory

  A factory class conforming to JSR-223 which is used to instantiate Groovy `ScriptEngines` and also exposes metadata describing Groovy's engine class.
  Author:
    Adapted from original by Mike Grogan, Adapted from original by A. Sundararajan, Jim White, Guillaume Laforge

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `GroovyScriptEngineFactory()`

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `String` | `getEngineName()`
    `String` | `getEngineVersion()` Note that the scripting.dev.java.net engine had this backwards.
    `List<String>` | `getExtensions()`
    `String` | `getLanguageName()` This is also different than scripting.dev.java.net which used an initial lowercase.
    `String` | `getLanguageVersion()`
    `String` | `getMethodCallSyntax(String obj, String method, String... args)`
    `List<String>` | `getMimeTypes()`
    `List<String>` | `getNames()`
    `String` | `getOutputStatement(String toDisplay)`
    `Object` | `getParameter(String key)`
    `String` | `getProgram(String... statements)`
    `ScriptEngine` | `getScriptEngine()`

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

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

- - ### Constructor Detail

    - #### GroovyScriptEngineFactory

          public GroovyScriptEngineFactory()

  - ### Method Detail

    - #### getEngineName

          public String getEngineName()

      Specified by:
        `getEngineName` in interface `ScriptEngineFactory`

    - #### getEngineVersion

          public String getEngineVersion()

      Note that the scripting.dev.java.net engine had this backwards. The engine version refers to this engine implementation. Whereas language version refers to the groovy implementation (which is obtained from the runtime).
      Specified by:
        `getEngineVersion` in interface `ScriptEngineFactory`

    - #### getLanguageName

          public String getLanguageName()

      This is also different than scripting.dev.java.net which used an initial lowercase. But these are proper names and should be capitalized.
      Specified by:
        `getLanguageName` in interface `ScriptEngineFactory`

    - #### getLanguageVersion

          public String getLanguageVersion()

      Specified by:
        `getLanguageVersion` in interface `ScriptEngineFactory`

    - #### getExtensions

          public List<String> getExtensions()

      Specified by:
        `getExtensions` in interface `ScriptEngineFactory`

    - #### getMimeTypes

          public List<String> getMimeTypes()

      Specified by:
        `getMimeTypes` in interface `ScriptEngineFactory`

    - #### getNames

          public List<String> getNames()

      Specified by:
        `getNames` in interface `ScriptEngineFactory`

    - #### getParameter

          public Object getParameter(String key)

      Specified by:
        `getParameter` in interface `ScriptEngineFactory`

    - #### getScriptEngine

          public ScriptEngine getScriptEngine()

      Specified by:
        `getScriptEngine` in interface `ScriptEngineFactory`

    - #### getMethodCallSyntax

          public String getMethodCallSyntax(String obj,
                                   String method,
                                   String... args)

      Specified by:
        `getMethodCallSyntax` in interface `ScriptEngineFactory`

    - #### getOutputStatement

          public String getOutputStatement(String toDisplay)

      Specified by:
        `getOutputStatement` in interface `ScriptEngineFactory`

    - #### getProgram

          public String getProgram(String... statements)

      Specified by:
        `getProgram` in interface `ScriptEngineFactory`