All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class org.webmacro.engine.Block

java.lang.Object
   |
   +----java.util.Vector
           |
           +----org.webmacro.engine.Block

public final class Block
extends Vector
implements Macro
A block represents the text between two {}'s in a template, or else the text that begins at the start of the template and runs until its end ({}'s around the whole document are not required). It contains all of the other directives, strings, etc. that can be in a template.


Method Index

 o evaluate(Object)
Evaluate the current macro and return it as a string.
 o main(String[])
test harness
 o parse(ParseTool)
Attempt to parse the block, or return null if what follows the current position is not actually a block.
 o write(Writer, Object)
Interpret the block and write it out

Methods

 o parse
 public static Object parse(ParseTool in) throws ParseException, IOException
Attempt to parse the block, or return null if what follows the current position is not actually a block.

Throws: ParseException
if the sytax was invalid and we could not recover
Throws: IOException
if we could not successfullly read the parseTool
 o evaluate
 public Object evaluate(Object context) throws InvalidContextException
Evaluate the current macro and return it as a string. Same basic operation as calling write.

Throws: InvalidContextException
if required data was missing from context
 o write
 public void write(Writer out,
                   Object context) throws InvalidContextException, IOException
Interpret the block and write it out

Throws: InvalidContextException
if required data was missing from context
Throws: IOException
if we could not successfully write to out
 o main
 public static void main(String args[])
test harness


All Packages  Class Hierarchy  This Package  Previous  Next  Index