Class GroovyScriptEngineFactory

java.lang.Object
org.codehaus.groovy.jsr223.GroovyScriptEngineFactory
All Implemented Interfaces:
javax.script.ScriptEngineFactory

public class GroovyScriptEngineFactory
extends java.lang.Object
implements javax.script.ScriptEngineFactory
A factory class conforming to JSR-223 which is used to instantiate Groovy ScriptEngines and also exposes metadata describing Groovy's engine class. Adapted from original by Mike Grogan and A. Sundararajan
  • Constructor Summary

    Constructors
    Constructor Description
    GroovyScriptEngineFactory()  
  • Method Summary

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

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • GroovyScriptEngineFactory

      public GroovyScriptEngineFactory()
  • Method Details

    • getEngineName

      public java.lang.String getEngineName()
      Specified by:
      getEngineName in interface javax.script.ScriptEngineFactory
    • getEngineVersion

      public java.lang.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 javax.script.ScriptEngineFactory
    • getLanguageName

      public java.lang.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 javax.script.ScriptEngineFactory
    • getLanguageVersion

      public java.lang.String getLanguageVersion()
      Specified by:
      getLanguageVersion in interface javax.script.ScriptEngineFactory
    • getExtensions

      public java.util.List<java.lang.String> getExtensions()
      Specified by:
      getExtensions in interface javax.script.ScriptEngineFactory
    • getMimeTypes

      public java.util.List<java.lang.String> getMimeTypes()
      Specified by:
      getMimeTypes in interface javax.script.ScriptEngineFactory
    • getNames

      public java.util.List<java.lang.String> getNames()
      Specified by:
      getNames in interface javax.script.ScriptEngineFactory
    • getParameter

      public java.lang.Object getParameter​(java.lang.String key)
      Specified by:
      getParameter in interface javax.script.ScriptEngineFactory
    • getScriptEngine

      public javax.script.ScriptEngine getScriptEngine()
      Specified by:
      getScriptEngine in interface javax.script.ScriptEngineFactory
    • getMethodCallSyntax

      public java.lang.String getMethodCallSyntax​(java.lang.String obj, java.lang.String method, java.lang.String... args)
      Specified by:
      getMethodCallSyntax in interface javax.script.ScriptEngineFactory
    • getOutputStatement

      public java.lang.String getOutputStatement​(java.lang.String toDisplay)
      Specified by:
      getOutputStatement in interface javax.script.ScriptEngineFactory
    • getProgram

      public java.lang.String getProgram​(java.lang.String... statements)
      Specified by:
      getProgram in interface javax.script.ScriptEngineFactory