|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.clapper.util.scripting.UnifiedScriptEngineManager
public abstract class UnifiedScriptEngineManager
A script engine manager that provides a common interface between the Apache Jakarta Bean Scripting Framework (BSF) and the Java 6 JSR 223 (javax.script) framework, allowing callers to use either underlying framework without changing code. This class is modeled on the JSR 223 interface, though it is much simpler.
| Constructor Summary | |
|---|---|
protected |
UnifiedScriptEngineManager()
Creates a new instance of UnifiedScriptEngineManager |
| Method Summary | |
|---|---|
abstract void |
clearBindings()
Clear all current bindings. |
abstract java.lang.Object |
get(java.lang.String key)
Get the value for a specified key in the object bindings. |
abstract java.util.Map<java.lang.String,java.lang.Object> |
getBindings()
Get the global object bindings. |
abstract UnifiedScriptEngine |
getEngineByExtension(java.lang.String extension)
Get a UnifiedScriptEngine for the specified language, by mapping a file name extension to the language. |
abstract UnifiedScriptEngine |
getEngineByName(java.lang.String language)
Get a UnifiedScriptEngine for the specified language. |
UnifiedScriptEngine |
getEngineForFile(java.io.File file)
Get a UnifiedScriptEngine for a given file, by using the file's extension. |
static UnifiedScriptEngineManager |
getManager(ScriptFrameworkType type)
Get the script engine manager for a specific underlying scripting framework. |
static UnifiedScriptEngineManager |
getManager(ScriptFrameworkType[] types)
Get the UnifiedScriptEngineManager for the first available underlying scripting framework. |
abstract ScriptFrameworkType |
getType()
Get the framework type ( ScriptFrameworkType associated with
the UnifiedScriptEngineManager object. |
abstract void |
put(java.lang.String name,
java.lang.Object object)
Put an object into the script environment. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
protected UnifiedScriptEngineManager()
| Method Detail |
|---|
public static final UnifiedScriptEngineManager getManager(ScriptFrameworkType type)
throws UnifiedScriptException
type - which underlying scripting framework to use
UnifiedScriptException - on errorgetManager(ScriptFrameworkType[])
public static final UnifiedScriptEngineManager getManager(ScriptFrameworkType[] types)
throws UnifiedScriptException
types - the framework types to check, in order.
UnifiedScriptException - if no script managers could be foundgetType(),
getManager(ScriptFrameworkType)public abstract ScriptFrameworkType getType()
ScriptFrameworkType associated with
the UnifiedScriptEngineManager object.
public abstract java.util.Map<java.lang.String,java.lang.Object> getBindings()
throws UnifiedScriptException
UnifiedScriptException - on errorclearBindings(),
put(java.lang.String, java.lang.Object)
public abstract void clearBindings()
throws UnifiedScriptException
UnifiedScriptException - on errorput(java.lang.String, java.lang.Object)
public abstract void put(java.lang.String name,
java.lang.Object object)
throws UnifiedScriptException
name - the name by which the object will be known to scriptsobject - the object
UnifiedScriptException - on errorpublic abstract java.lang.Object get(java.lang.String key)
key - the key
public abstract UnifiedScriptEngine getEngineByName(java.lang.String language)
throws UnifiedScriptException
language - the language name
UnifiedScriptException - on error
public abstract UnifiedScriptEngine getEngineByExtension(java.lang.String extension)
throws UnifiedScriptException
extension - the extension
UnifiedScriptException - on error
public UnifiedScriptEngine getEngineForFile(java.io.File file)
throws UnifiedScriptException
file - the file
UnifiedScriptException - on errorgetEngineByExtension(java.lang.String)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||