ScriptEngineFactory is used to describe and instantiate
ScriptEngines.
ScriptEngine has a corresponding
factory that exposes metadata describing the engine class.
ScriptEngineManager
uses the service-provider loader mechanism described in the
java.util.ServiceLoader class to obtain
instances of ScriptEngineFactory instances.
See ScriptEngineManager#ScriptEngineManager() and
ScriptEngineManager#ScriptEngineManager(java.lang.ClassLoader) .
| Modifier and Type | Method and Description |
|---|---|
| public String | Returns: The name of the engine implementation.Returns the full name of the |
| public String | Returns: TheScriptEngine implementation version.Returns the version of the |
| public List | Returns: The list of extensions.Returns an immutable list of filename extensions, which generally identify scripts
written in the language supported by this |
| public String | Returns: The name of the supported language.Returns the name of the scripting language supported by this
|
| public String | Returns: The version of the supported language.Returns the version of the scripting language supported by this
|
| public String | Returns: The String used to invoke the method in the syntax of the scripting language.The name representing the object whose method is to be invoked. The
name is the one used to create bindings using the obj, String put method of
ScriptEngine, the put method of an ENGINE_SCOPE
Bindings,or the setAttribute method
of ScriptContext. The identifier used in scripts may be a decorated form of the
specified one.The name of the method to invoke. m, String... names of the arguments in the method call. args)Returns a String which can be used to invoke a method of a Java object using the syntax of the supported scripting language. |
| public List | Returns: The list of mime types.Returns an immutable list of mimetypes, associated with scripts that can be executed by the engine. |
| public List | Returns: an immutable list of short namesReturns an immutable list of short names for the |
| public String | Returns: The string used to display the String in the syntax of the scripting language.The String to be displayed by the returned statement. toDisplay)Returns a String that can be used as a statement to display the specified String using the syntax of the supported scripting language. |
| public Object | Returns: The value for the given parameter. Returnsnull if no
value is assigned to the key.The name of the parameter key)Returns the value of an attribute whose meaning may be implementation-specific. |
| public String | Returns: The ProgramThe statements to be executed. May be return values of
calls to the statements)getMethodCallSyntax and getOutputStatement methods.Returns a valid scripting language executable program with given statements. |
| public ScriptEngine | Returns: A newScriptEngine instance.Returns an instance of the |
| getEngineName | back to summary |
|---|---|
| public String getEngineName() Returns the full name of the
| |
| getEngineVersion | back to summary |
|---|---|
| public String getEngineVersion() Returns the version of the
| |
| getExtensions | back to summary |
|---|---|
| public List Returns an immutable list of filename extensions, which generally identify scripts
written in the language supported by this | |
| getLanguageName | back to summary |
|---|---|
| public String getLanguageName() Returns the name of the scripting language supported by this
| |
| getLanguageVersion | back to summary |
|---|---|
| public String getLanguageVersion() Returns the version of the scripting language supported by this
| |
| getMethodCallSyntax | back to summary |
|---|---|
| public String getMethodCallSyntax(String obj, String m, String... args) Returns a String which can be used to invoke a method of a Java object using the syntax of the supported scripting language. For instance, an implementation for a Javascript engine might be;
| |
| getMimeTypes | back to summary |
|---|---|
| public List Returns an immutable list of mimetypes, associated with scripts that
can be executed by the engine. The list is used by the
| |
| getNames | back to summary |
|---|---|
| public List Returns an immutable list of short names for the | |
| getOutputStatement | back to summary |
|---|---|
| public String getOutputStatement(String toDisplay) Returns a String that can be used as a statement to display the specified String using the syntax of the supported scripting language. For instance, the implementation for a Perl engine might be;
| |
| getParameter | back to summary |
|---|---|
| public Object getParameter(String key) Returns the value of an attribute whose meaning may be implementation-specific. Keys for which the value is defined in all implementations are:
The values for these keys are the Strings returned by
Implementations may define implementation-specific keys.
| |
| getProgram | back to summary |
|---|---|
| public String getProgram(String... statements) Returns a valid scripting language executable program with given statements. For instance an implementation for a PHP engine might be:
| |
| getScriptEngine | back to summary |
|---|---|
| public ScriptEngine getScriptEngine() Returns an instance of the
| |