org.jopendocument.dom.template.engine
Class Processor<E>

java.lang.Object
  extended by org.jopendocument.dom.template.engine.Processor<E>
Type Parameters:
E - type of material this processor uses.

public class Processor<E>
extends java.lang.Object

Generates the final document content from the preprocessed template content.

The behaviour of the substitution of fields can be controlled with prefixes :

AS_STR
the following expression will be substitued as a String. For an XML element its tree will be outputed.
ENCODE
the following expression will be converted to a String with toString() and then encoded using OOXML.encodeWS(String).
OO_XML
the following expression will be converted to a String with toString() and then parsed as OO XML.
If none of these is specified, an XML element will be treated as OO XML to be grafted (only its children), else the value will simply be set as text of the field.


Field Summary
static java.lang.String AS_STR
           
static java.lang.String ENCODE
           
static java.lang.String OO_XML
           
 
Method Summary
 Material<E> getMaterial()
           
 Parsed<E> getParsed()
           
 Material<E> process()
           
 void transform(org.jdom.Element element)
          Transforms recursively the passed element.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

OO_XML

public static final java.lang.String OO_XML
See Also:
Constant Field Values

ENCODE

public static final java.lang.String ENCODE
See Also:
Constant Field Values

AS_STR

public static final java.lang.String AS_STR
See Also:
Constant Field Values
Method Detail

getParsed

public final Parsed<E> getParsed()

getMaterial

public Material<E> getMaterial()

process

public Material<E> process()
                    throws TemplateException
Throws:
TemplateException

transform

public void transform(org.jdom.Element element)
               throws TemplateException
Transforms recursively the passed element. That means :

Parameters:
element - the element to be processed.
Throws:
TemplateException