org.jopendocument.dom.template.statements
Class Statement

java.lang.Object
  extended by org.jopendocument.dom.template.statements.Statement
Direct Known Subclasses:
BaseStatement, Include

public abstract class Statement
extends java.lang.Object

A statement that will be executed to modify the parsed xml.

Author:
Sylvain

Field Summary
static org.jdom.Namespace stmtNS
           
 
Constructor Summary
Statement(java.lang.String name)
           
 
Method Summary
abstract  void execute(Processor<?> processor, org.jdom.Element elem, DataModel model)
          Should produce valid OpenDocument XML.
 java.lang.String getName()
          The name of this statement.
abstract  boolean matches(org.jdom.Element elem)
          Find representations of this statement.
abstract  void prepare(org.jdom.Element elem)
          Creates an element named getName().
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

stmtNS

public static final org.jdom.Namespace stmtNS
Constructor Detail

Statement

public Statement(java.lang.String name)
Method Detail

getName

public final java.lang.String getName()
The name of this statement. prepare(Element) must create an Element with that name.

Returns:
the name of this statement.

matches

public abstract boolean matches(org.jdom.Element elem)
Find representations of this statement.

Parameters:
elem - the element to test.
Returns:
true if elem should prepared by this statement.

prepare

public abstract void prepare(org.jdom.Element elem)
                      throws TemplateException
Creates an element named getName().

Parameters:
elem - an element that returned true with matches(Element).
Throws:
TemplateException

execute

public abstract void execute(Processor<?> processor,
                             org.jdom.Element elem,
                             DataModel model)
                      throws TemplateException
Should produce valid OpenDocument XML.

Parameters:
processor - the processor.
elem - an element that has been prepared.
model - the data.
Throws:
TemplateException

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object