public class RhinoExecutor extends Object implements IScriptScope
| Constructor and Description |
|---|
RhinoExecutor(org.mozilla.javascript.ScriptableObject rootScope) |
| Modifier and Type | Method and Description |
|---|---|
IScriptScope |
addObjectProperty(String name)
Create a new object property inside this one, with the specified name.
|
org.mozilla.javascript.Script |
compile(Reader r,
String filename) |
org.mozilla.javascript.Script |
compile(String s,
String filename) |
<T> T |
eval(Class<T> targetType,
Reader r,
String sourceFileNameIndicator) |
<T> T |
eval(Class<T> targetType,
String expression,
String sourceFileNameIndicator) |
<T> T |
getAdapter(Class<T> clz) |
<T> List<T> |
getProperties(Class<T> filterClass)
Get all properties of this object.
|
<T> T |
getValue(Class<T> targetType,
String name)
Return the value for the specified variable in this scope.
|
RhinoScriptScope |
newScope()
Create a new writable scope that has this scope as the "delegate".
|
void |
put(String name,
Object instance)
Put a simple value inside the scope.
|
Object |
toObject(Object o) |
protected <T> T |
translateValue(Class<T> targetClass,
Object val) |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitaddObjectProperty, eval, eval, getAdapter, getProperties, getValue, newScope, putpublic RhinoExecutor(org.mozilla.javascript.ScriptableObject rootScope)
public org.mozilla.javascript.Script compile(Reader r, String filename) throws Exception
Exceptionpublic org.mozilla.javascript.Script compile(String s, String filename) throws Exception
Exceptionpublic void put(@Nonnull String name, @Nullable Object instance)
IScriptScopeput in interface IScriptScope@Nonnull public RhinoScriptScope newScope()
IScriptScopenewScope in interface IScriptScope@Nullable public <T> T getValue(@Nonnull Class<T> targetType, @Nonnull String name)
IScriptScopegetValue in interface IScriptScopeto.etc.domui.util.js.IScriptScope#getValue(java.lang.String)@Nullable public <T> T getAdapter(@Nonnull Class<T> clz)
getAdapter in interface IScriptScope@Nonnull public <T> List<T> getProperties(@Nonnull Class<T> filterClass)
IScriptScopegetProperties in interface IScriptScope@Nullable public <T> T eval(@Nonnull Class<T> targetType, @Nonnull Reader r, @Nonnull String sourceFileNameIndicator) throws Exception
eval in interface IScriptScopeExceptionpublic <T> T eval(@Nonnull Class<T> targetType, @Nonnull String expression, @Nonnull String sourceFileNameIndicator) throws Exception
eval in interface IScriptScopeException@Nonnull public IScriptScope addObjectProperty(@Nonnull String name)
IScriptScopeaddObjectProperty in interface IScriptScopeCopyright © 2017 etc.to. All rights reserved.