|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface ScriptEngineFactory
See Javadoc of Java Scripting API
Method Summary | |
---|---|
String |
getEngineName()
Retrieves the full name of the ScriptEngine. |
String |
getEngineVersion()
Retrieves the version of the Script Engine. |
List |
getExtensions()
Retrieves an immutable list of Strings which are file extensions typically used for files containing scripts written in the language supported by the ScriptEngine. |
String |
getLanguageName()
Retrieves the name of the language supported by the ScriptEngine. |
String |
getLanguageVersion()
Retrieves the version of the language supported by the ScriptEngine. |
String |
getMethodCallSyntax(String objectName,
String method,
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. |
List |
getMimeTypes()
Retrieves an immutable list of Strings containing MIME types describing the content which can be processed using the Script Engine. |
List |
getNames()
Retrieves an immutable list of short descriptive names such as {"javascript", "rhino"} describing the language supported by the Script Engine. |
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. |
Object |
getParameter(String key)
Retrieves an associated value for the specified key. |
String |
getProgram(String[] statements)
Returns A valid scripting language executable progam with given statements. |
ScriptEngine |
getScriptEngine()
Retrieves an instance of the associated ScriptEngine. |
Method Detail |
---|
ScriptEngine getScriptEngine()
String getEngineName()
String getEngineVersion()
String getLanguageName()
String getLanguageVersion()
List getExtensions()
List getMimeTypes()
List getNames()
Object getParameter(String key)
String getMethodCallSyntax(String objectName, String method, String[] args)
public String getMethodCallSyntax(String objectName, String method, String[] args) { String ret = objectName; ret += "." + method + "("; for (int i = 0; i < args.length; i++) { ret += args[i]; if (i == args.length - 1) { ret += ")"; } else { ret += ","; } } return ret; }
objectName
- The name representing the object whose method is to be invoked.method
- The name of the method to invoke.args
- names of the arguments in the method call.
String getOutputStatement(String toDisplay)
public String getOutputStatement(String toDisplay) { return "print(" + toDisplay + ")"; }
toDisplay
- the string to be displayed
String getProgram(String[] statements)
public String getProgram(String... statements) { $retval = "<?\n"; int len = statements.length; for (int i = 0; i < len; i++) { $retval += statements[i] + ";\n"; } $retval += "?>"; }
statements
- the statements to be executed,
e.g. as returned by the getMethodCallSyntax(java.lang.String, java.lang.String, java.lang.String[])
or getOutputStatement(java.lang.String)
methods
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |