|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.apache.tapestry.script.ScriptSessionImpl
public class 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)
ScriptSessionsymbols map.
evaluate in interface ScriptSession
public java.lang.Object evaluate(java.lang.String expression,
java.lang.Class desiredType)
ScriptSession
evaluate in interface ScriptSessionValueConverterpublic org.apache.hivemind.Resource getScriptTemplateResource()
ScriptSession
getScriptTemplateResource in interface ScriptSessionpublic java.util.Map getSymbols()
ScriptSession
getSymbols in interface ScriptSessionpublic IRequestCycle getRequestCycle()
ScriptSession
getRequestCycle in interface ScriptSessionpublic void addBodyScript(java.lang.String script)
IScriptProcessorBody component will write the body script contents
just inside the <body> tag.
addBodyScript in interface IScriptProcessorpublic void addExternalScript(org.apache.hivemind.Resource resource)
IScriptProcessor
addExternalScript in interface IScriptProcessorpublic 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 IScriptProcessorpublic java.lang.String toString()
toString in class java.lang.Object
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||