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.
Adapted from original by Mike Grogan and A. Sundararajan
| Type Params | Return Type | Name and description |
|---|---|---|
|
public String |
getEngineName()Returns the display name of this script engine implementation. |
|
public String |
getEngineVersion()Note that the scripting.dev.java.net engine had this backwards. |
|
public List<String> |
getExtensions()Returns the file extensions recognized by this engine. |
|
public String |
getLanguageName()This is also different from scripting.dev.java.net which used an initial lowercase. |
|
public String |
getLanguageVersion()Returns the version of the Groovy language available at runtime. |
|
public String |
getMethodCallSyntax(String obj, String method, String args)Formats a Groovy method call using the supplied receiver, method name, and arguments. |
|
public List<String> |
getMimeTypes()Returns the MIME types associated with Groovy scripts. |
|
public List<String> |
getNames()Returns the short and display names accepted when locating this engine. |
|
public String |
getOutputStatement(String toDisplay)Produces a Groovy statement that prints the supplied text. |
|
public Object |
getParameter(String key)Resolves a standard JSR-223 metadata key for this engine. |
|
public String |
getProgram(String statements)Joins multiple Groovy statements into a single program. |
|
public ScriptEngine |
getScriptEngine()Creates a new Groovy script engine backed by this factory. |
Returns the display name of this script engine implementation.
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).
Returns the file extensions recognized by this engine.
This is also different from scripting.dev.java.net which used an initial lowercase. But these are proper names and should be capitalized.
Returns the version of the Groovy language available at runtime.
Formats a Groovy method call using the supplied receiver, method name, and arguments.
obj - the expression identifying the receiver objectmethod - the method name to callargs - the argument expressions to include in the invocationmethod on objReturns the MIME types associated with Groovy scripts.
Returns the short and display names accepted when locating this engine.
Produces a Groovy statement that prints the supplied text.
toDisplay - the text to renderprintln statement with embedded quotes and backslashes escapedResolves a standard JSR-223 metadata key for this engine.
key is not supported by this factorykey - the metadata key to resolvekeyJoins multiple Groovy statements into a single program.
statements - the statements to concatenate in source orderCreates a new Groovy script engine backed by this factory.