org.apache.tapestry.script
Class ParsedScript

java.lang.Object
  extended by org.apache.tapestry.script.ParsedScript
All Implemented Interfaces:
ILocatable, IScript, IScriptToken

public class ParsedScript
extends Object
implements IScript

A top level container for a number of script tokens.

Since:
0.2.9
Version:
$Id: ParsedScript.java 243791 2004-02-19 17:38:13Z hlship $
Author:
Howard Lewis Ship

Constructor Summary
ParsedScript(ILocation location)
           
 
Method Summary
 void addToken(IScriptToken token)
          Invoked during parsing to add the token parameter as a child of this token.
protected  Object evaluate(String expression, ScriptSession session)
          Evaluates the expression against the session's symbols, using OgnlUtils.get(String, ClassResolver, Object) and returns the result.
 void execute(IRequestCycle cycle, IScriptProcessor processor, Map symbols)
          Creates the ScriptSession and invokes AbstractToken.writeChildren(java.lang.StringBuffer, org.apache.tapestry.script.ScriptSession).
 ILocation getLocation()
          Returns the location from which this object orginates, or null if not known.
 IResourceLocation getScriptLocation()
          Returns the location from which the script was loaded.
 void write(StringBuffer buffer, ScriptSession session)
          Does nothing; never invoked.
protected  void writeChildren(StringBuffer buffer, ScriptSession session)
          Invokes IScriptToken.write(StringBuffer,ScriptSession) on each child token (if there are any).
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ParsedScript

public ParsedScript(ILocation location)
Method Detail

getScriptLocation

public IResourceLocation getScriptLocation()
Description copied from interface: IScript
Returns the location from which the script was loaded.

Specified by:
getScriptLocation in interface IScript

execute

public void execute(IRequestCycle cycle,
                    IScriptProcessor processor,
                    Map symbols)
Creates the ScriptSession and invokes AbstractToken.writeChildren(java.lang.StringBuffer, org.apache.tapestry.script.ScriptSession).

Specified by:
execute in interface IScript
Parameters:
cycle - the current request cycle
processor - an object that processes the results of the script, typically an instance of Body
symbols - Map of input symbols; execution of the script may modify the map, creating new output symbols
See Also:
Body.get(IRequestCycle)

write

public void write(StringBuffer buffer,
                  ScriptSession session)
Does nothing; never invoked.

Specified by:
write in interface IScriptToken

getLocation

public ILocation getLocation()
Description copied from interface: ILocatable
Returns the location from which this object orginates, or null if not known.

Specified by:
getLocation in interface ILocatable

addToken

public void addToken(IScriptToken token)
Description copied from interface: IScriptToken
Invoked during parsing to add the token parameter as a child of this token.

Specified by:
addToken in interface IScriptToken

writeChildren

protected void writeChildren(StringBuffer buffer,
                             ScriptSession session)
Invokes IScriptToken.write(StringBuffer,ScriptSession) on each child token (if there are any).


evaluate

protected Object evaluate(String expression,
                          ScriptSession session)
Evaluates the expression against the session's symbols, using OgnlUtils.get(String, ClassResolver, Object) and returns the result.