|
||||||||||
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(IComponent, 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,
IComponent component,
IRequestCycle cycle,
IScriptProcessor processor,
ExpressionEvaluator evaluator,
ValueConverter valueConverter,
Map symbols)
|
|
ScriptSessionImpl(org.apache.hivemind.Resource scriptTemplateResource,
IRequestCycle cycle,
IScriptProcessor processor,
ExpressionEvaluator evaluator,
ValueConverter valueConverter,
Map symbols)
|
Method Summary | |
---|---|
void |
addBodyScript(IComponent target,
String script)
Adds scripting code to the main body. |
void |
addBodyScript(String script)
Adds scripting code to the main body. |
void |
addExternalScript(IComponent target,
org.apache.hivemind.Resource resource)
Adds an external script. |
void |
addExternalScript(org.apache.hivemind.Resource resource)
Adds an external script. |
void |
addInitializationScript(IComponent target,
String script)
Adds initialization script. |
void |
addInitializationScript(String script)
Adds initialization script. |
void |
addScriptAfterInitialization(IComponent target,
String script)
Works in the same way as IScriptProcessor.addInitializationScript(IComponent, String) - except this
method causes the script being added to appear after all of the script content written out
from the normal initialization script processing happens. |
Object |
evaluate(String expression)
Evaluates an OGNL expression, where the root object for the expression is the symbols map . |
Object |
evaluate(String expression,
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. |
Map |
getSymbols()
Returns the symbols (which may be created or updated during the execution of the script template). |
String |
getUniqueString(String baseValue)
Ensures that the given string is unique. |
boolean |
isBodyScriptAllowed(IComponent target)
Determines if the specified component should have its javascript body added to the response. |
boolean |
isExternalScriptAllowed(IComponent target)
Determines if the specified component should have its javascript external resource scripts added to the response. |
boolean |
isInitializationScriptAllowed(IComponent target)
Determines if the specified component should have its javascript initialization added to the response. |
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, Map symbols)
public ScriptSessionImpl(org.apache.hivemind.Resource scriptTemplateResource, IComponent component, IRequestCycle cycle, IScriptProcessor processor, ExpressionEvaluator evaluator, ValueConverter valueConverter, Map symbols)
Method Detail |
---|
public Object evaluate(String expression)
ScriptSession
symbols map
.
evaluate
in interface ScriptSession
public Object evaluate(String expression, Class desiredType)
ScriptSession
evaluate
in interface ScriptSession
ValueConverter
public org.apache.hivemind.Resource getScriptTemplateResource()
ScriptSession
getScriptTemplateResource
in interface ScriptSession
public Map getSymbols()
ScriptSession
getSymbols
in interface ScriptSession
public IRequestCycle getRequestCycle()
ScriptSession
getRequestCycle
in interface ScriptSession
public void addBodyScript(String script)
IScriptProcessor
Body
component will write the body script contents
just inside the <body>
tag.
addBodyScript
in interface IScriptProcessor
#addBodyScript(IComponent, String)}
public boolean isBodyScriptAllowed(IComponent target)
isBodyScriptAllowed
in interface IScriptProcessor
target
- The component to allow/disallow body script content from.
public boolean isExternalScriptAllowed(IComponent target)
isExternalScriptAllowed
in interface IScriptProcessor
target
- The component to check for inclusion/exclusion.
public boolean isInitializationScriptAllowed(IComponent target)
isInitializationScriptAllowed
in interface IScriptProcessor
target
- The component to allow/disallow initialization script content from.
public void addBodyScript(IComponent target, String script)
IScriptProcessor
Body
component will write the body script contents
just inside the <body>
tag.
addBodyScript
in interface IScriptProcessor
target
- The component this script is being added for.script
- The script to add to the body response.public void addExternalScript(org.apache.hivemind.Resource resource)
IScriptProcessor
addExternalScript
in interface IScriptProcessor
#addExternalScript(IComponent, Resource)}
public void addExternalScript(IComponent target, org.apache.hivemind.Resource resource)
IScriptProcessor
addExternalScript
in interface IScriptProcessor
target
- The component the script is being added for.resource
- The external script to add.public void addInitializationScript(String script)
IScriptProcessor
</body>
tag).
addInitializationScript
in interface IScriptProcessor
#addInitializationScript(IComponent, String)}
public void addInitializationScript(IComponent target, String script)
IScriptProcessor
</body>
tag).
addInitializationScript
in interface IScriptProcessor
target
- The component the script is being added for.script
- The script to add.public void addScriptAfterInitialization(IComponent target, String script)
IScriptProcessor
IScriptProcessor.addInitializationScript(IComponent, String)
- except this
method causes the script being added to appear after all of the script content written out
from the normal initialization script processing happens. This is useful if you have some initialization
script logic that absolutely must happen at the very end of the rest of things.
addScriptAfterInitialization
in interface IScriptProcessor
target
- The component the script is being added for.script
- The script to add.#addInitializationScript(IComponent, String)}.
public String getUniqueString(String baseValue)
IScriptProcessor
getUniqueString
in interface IScriptProcessor
public String toString()
toString
in class Object
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |