|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectro.isdc.wro.extensions.script.RhinoScriptBuilder
public class RhinoScriptBuilder
Used to evaluate javascript on the serverside using rhino javascript engine. Encapsulate and hides all implementation details used by rhino to evaluate javascript on the serverside.
| Method Summary | |
|---|---|
RhinoScriptBuilder |
addClientSideEnvironment()
Add a clinet side environment to the script context (client-side aware). |
RhinoScriptBuilder |
addJSON()
|
Object |
evaluate(Reader reader,
String sourceName)
Evaluates a script from a reader. |
Object |
evaluate(String script,
String sourceName)
Evaluates a script. |
RhinoScriptBuilder |
evaluateChain(InputStream stream,
String sourceName)
Evaluates a script and return RhinoScriptBuilder for a chained script evaluation. |
RhinoScriptBuilder |
evaluateChain(String script,
String sourceName)
Evaluates a script and return RhinoScriptBuilder for a chained script evaluation. |
org.mozilla.javascript.ScriptableObject |
getScope()
|
void |
initContext()
|
static RhinoScriptBuilder |
newChain()
|
static RhinoScriptBuilder |
newChain(org.mozilla.javascript.ScriptableObject scope)
|
static RhinoScriptBuilder |
newClientSideAwareChain()
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Method Detail |
|---|
public org.mozilla.javascript.ScriptableObject getScope()
public RhinoScriptBuilder addClientSideEnvironment()
RhinoScriptBuilder used to chain evaluation of the scripts.
IOExceptionpublic RhinoScriptBuilder addJSON()
public RhinoScriptBuilder evaluateChain(InputStream stream,
String sourceName)
throws IOException
RhinoScriptBuilder for a chained script evaluation.
stream - InputStream of the script to evaluate.sourceName - the name of the evaluated script.
RhinoScriptBuilder chain with required script evaluated.
IOException - if the script couldn't be retrieved.public void initContext()
public RhinoScriptBuilder evaluateChain(String script,
String sourceName)
RhinoScriptBuilder for a chained script evaluation.
script - the string representation of the script to evaluate.sourceName - the name of the evaluated script.
IOException - if the script couldn't be retrieved.
public Object evaluate(Reader reader,
String sourceName)
throws IOException
reader - Reader of the script to evaluate.sourceName - the name of the evaluated script.
IOException - if the script couldn't be retrieved.
public Object evaluate(String script,
String sourceName)
script - string representation of the script to evaluate.sourceName - the name of the evaluated script.
IOException - if the script couldn't be retrieved.public static RhinoScriptBuilder newChain()
RhinoScriptBuilder for script evaluation chaining.public static RhinoScriptBuilder newChain(org.mozilla.javascript.ScriptableObject scope)
public static RhinoScriptBuilder newClientSideAwareChain()
RhinoScriptBuilder for script evaluation chaining.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||