|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.tapestry.script.ScriptSessionImpl
The result of executing a script, the session is used during the parsing process as well.
Following
IScript.execute(org.apache.tapestry.IRequestCycle, org.apache.tapestry.IScriptProcessor, java.util.Map)
,
the session provides access to output symbols as well as the body and initialization blocks
created by the script tokens.
Constructor Summary | |
ScriptSessionImpl(org.apache.hivemind.Resource scriptTemplateResource,
IRequestCycle cycle,
IScriptProcessor processor,
ExpressionEvaluator evaluator,
ValueConverter valueConverter,
java.util.Map symbols)
|
Method Summary | |
void |
addBodyScript(java.lang.String script)
Adds scripting code to the main body. |
void |
addExternalScript(org.apache.hivemind.Resource resource)
Adds an external script. |
void |
addInitializationScript(java.lang.String script)
Adds initialization script. |
java.lang.Object |
evaluate(java.lang.String expression)
Evaluates an OGNL expression, where the root object for the expression is the symbols map . |
java.lang.Object |
evaluate(java.lang.String expression,
java.lang.Class desiredType)
Evaluates an expression and coerces the result to a particlar type. |
IRequestCycle |
getRequestCycle()
Returns the current request cycle. |
org.apache.hivemind.Resource |
getScriptTemplateResource()
Returns the resource for the script template. |
java.util.Map |
getSymbols()
Returns the symbols (which may be created or updated during the execution of the script template). |
java.lang.String |
getUniqueString(java.lang.String baseValue)
Ensures that the given string is unique. |
java.lang.String |
toString()
|
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
public ScriptSessionImpl(org.apache.hivemind.Resource scriptTemplateResource, IRequestCycle cycle, IScriptProcessor processor, ExpressionEvaluator evaluator, ValueConverter valueConverter, java.util.Map symbols)
Method Detail |
public java.lang.Object evaluate(java.lang.String expression)
ScriptSession
symbols map
.
evaluate
in interface ScriptSession
public java.lang.Object evaluate(java.lang.String expression, java.lang.Class desiredType)
ScriptSession
evaluate
in interface ScriptSession
ValueConverter
public org.apache.hivemind.Resource getScriptTemplateResource()
ScriptSession
getScriptTemplateResource
in interface ScriptSession
public java.util.Map getSymbols()
ScriptSession
getSymbols
in interface ScriptSession
public IRequestCycle getRequestCycle()
ScriptSession
getRequestCycle
in interface ScriptSession
public void addBodyScript(java.lang.String script)
IScriptProcessor
Body
component will write the body script contents
just inside the <body>
tag.
addBodyScript
in interface IScriptProcessor
public void addExternalScript(org.apache.hivemind.Resource resource)
IScriptProcessor
addExternalScript
in interface IScriptProcessor
public void addInitializationScript(java.lang.String script)
IScriptProcessor
</body> tag).
- Specified by:
addInitializationScript
in interface IScriptProcessor
public java.lang.String getUniqueString(java.lang.String baseValue)
IScriptProcessor
getUniqueString
in interface IScriptProcessor
public java.lang.String toString()
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |