public class ScriptMixin extends Object implements InvocationHandler, ScriptReloadable, ScriptRedirect, ScriptAttributes, ScriptAttributes.All
ScriptAttributes.All
Constructor and Description |
---|
ScriptMixin(PolygeneSPI spi,
Object thisComposite,
StateHolder state,
Layer layer,
Module module,
Application application) |
Modifier and Type | Method and Description |
---|---|
Object |
getAttribute(String name)
Fetch the value of the named attribute.
|
Object |
getEngineAttribute(String name) |
Object |
getGlobalAttribute(String name) |
Object |
invoke(Object proxy,
Method method,
Object[] objects) |
void |
reloadScript() |
void |
setEngineAttribute(String name,
Object value) |
void |
setGlobalAttribute(String name,
Object value) |
void |
setStdErr(Writer writer) |
void |
setStdIn(Reader reader) |
void |
setStdOut(Writer writer) |
public ScriptMixin(@Structure PolygeneSPI spi, @This Object thisComposite, @State StateHolder state, @Structure Layer layer, @Structure Module module, @Structure Application application)
public Object invoke(Object proxy, Method method, Object[] objects) throws Throwable
invoke
in interface InvocationHandler
Throwable
public void reloadScript()
reloadScript
in interface ScriptReloadable
public void setStdOut(Writer writer)
setStdOut
in interface ScriptRedirect
public void setStdErr(Writer writer)
setStdErr
in interface ScriptRedirect
public void setStdIn(Reader reader)
setStdIn
in interface ScriptRedirect
public Object getAttribute(String name)
ScriptAttributes
If the attribute name is found in ENGINE scope, it is returned. If it is not in the ENGINE scope, then the value is fetched from GLOBAL scope. If not present in either scope, NULL is returned.
getAttribute
in interface ScriptAttributes
name
- The name of the attribute to get, or null if not found.public Object getEngineAttribute(String name)
getEngineAttribute
in interface ScriptAttributes.All
public Object getGlobalAttribute(String name)
getGlobalAttribute
in interface ScriptAttributes.All
public void setEngineAttribute(String name, Object value)
setEngineAttribute
in interface ScriptAttributes.All
public void setGlobalAttribute(String name, Object value)
setGlobalAttribute
in interface ScriptAttributes.All