org.jopendocument.dom.template.statements
Class ForEach
java.lang.Object
org.jopendocument.dom.template.statements.Statement
org.jopendocument.dom.template.statements.BaseStatement
org.jopendocument.dom.template.statements.ForEach
public class ForEach
- extends BaseStatement
ForEach tag: repeats a document element for each item in a collection.
Attributes:
- element (required): the document element to which this tag applies, e.g. "table-row"
- items (required): expression evaluating to a Collection to be iterated
- var (required): variable name where the current iteration item is stored
- alternate (optional): number of document elements to be alternated during iteration,
typically used for alternating row background colors with a value of "2"
- multiple (optional): number of document elements to be copied during iteration, not
compatible with "alternate".
| Fields inherited from class org.jopendocument.dom.template.statements.Statement |
stmtNS |
|
Method Summary |
void |
execute(Processor processor,
org.jdom.Element tag,
DataModel model)
Should produce valid OpenDocument XML. |
void |
prepare(org.jdom.Element script,
org.jdom.Element command)
|
ForEach
public ForEach()
prepare
public void prepare(org.jdom.Element script,
org.jdom.Element command)
throws TemplateException
- Specified by:
prepare in class BaseStatement
- Throws:
TemplateException
execute
public void execute(Processor processor,
org.jdom.Element tag,
DataModel model)
throws TemplateException
- Description copied from class:
Statement
- Should produce valid OpenDocument XML.
- Specified by:
execute in class Statement
- Parameters:
processor - the processor.tag - an element that has been prepared.model - the data.
- Throws:
TemplateException
Copyright © 2010 jOpenDocument All Rights Reserved.