|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjavax.script.ScriptEngineManager
public class ScriptEngineManager
See Javadoc of Java Scripting API
Constructor Summary | |
---|---|
ScriptEngineManager()
Constructs a ScriptEngineManager and initializes it using the current context classloader. |
|
ScriptEngineManager(ClassLoader loader)
Constructs a ScriptEngineManager and initializes it using the specified classloader. |
Method Summary | |
---|---|
Object |
get(String key)
Retrieves the associated value for the spefied key in the GLOBAL_SCOPE |
Bindings |
getBindings()
Retrieves the bindings corresponds to GLOBAL_SCOPE. |
ScriptEngine |
getEngineByExtension(String extension)
Retrieves a new instance of a ScriptingEngine for the specified extension of a script file. |
ScriptEngine |
getEngineByMimeType(String mimeType)
Retrieves new instance the ScriptingEngine for a specifed MIME type. |
ScriptEngine |
getEngineByName(String shortName)
Retrieves a new instance of a ScriptEngine the specified descriptive name. |
List |
getEngineFactories()
Retrieves an array of instances of ScriptEngineFactory class which are found by the discovery mechanism. |
void |
put(String key,
Object value)
Associates the specifed value with the specified key in GLOBAL_SCOPE. |
void |
registerEngineExtension(String extension,
ScriptEngineFactory factory)
Register a extension with a ScriptEngineFactory. |
void |
registerEngineMimeType(String mimeType,
ScriptEngineFactory factory)
Registers a MIME type with a ScriptEngineFactory. |
void |
registerEngineName(String name,
ScriptEngineFactory factory)
Registers descriptive name with a ScriptEngineFactory. |
void |
setBindings(Bindings bindings)
Sets the GLOBAL_SCOPE value to the specified bindings. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public ScriptEngineManager()
public ScriptEngineManager(ClassLoader loader)
loader
- the classloader to use (may be null)Method Detail |
---|
public Object get(String key)
key
- the associated key of the value stored in the
GLOBAL_SCOPE
public ScriptEngine getEngineByExtension(String extension)
extension
- the specified extension of a script file
NullPointerException
- if extension is nullpublic ScriptEngine getEngineByMimeType(String mimeType)
mimeType
- the specified MIME type
NullPointerException
- if mimeType is nullpublic ScriptEngine getEngineByName(String shortName)
shortName
- the short name of the engine
NullPointerException
- - if shortName is nullpublic List getEngineFactories()
public Bindings getBindings()
public void put(String key, Object value)
key
- the associated key for specified valuevalue
- the associated value for the specified key
NullPointerException
- if key is null
IllegalArgumentException
- if key is the empty Stringpublic void registerEngineExtension(String extension, ScriptEngineFactory factory)
extension
- the extension associated with the specified
ScriptEngineFactory classfactory
- the ScriptEngineFactory associated with
the specified extension
NullPointerException
- if any of the parameters is nullpublic void registerEngineName(String name, ScriptEngineFactory factory)
name
- a descriptive name associated with the specifed
ScriptEngineFactory classfactory
- the ScriptEngineFactory associated with
the specified descriptive name
NullPointerException
- if any of the parameters is nullpublic void registerEngineMimeType(String mimeType, ScriptEngineFactory factory)
mimeType
- the MIME type associated with specified
ScriptEngineFactory classfactory
- the ScriptEngineFactory associated with the
specified MIME type
NullPointerException
- if any of the parameters is nullpublic void setBindings(Bindings bindings)
bindings
- the bindings to be stored in GLOBAL_SCOPE
IllegalArgumentException
- if bindings is null
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |