org.jopendocument.dom.template
Class Template
java.lang.Object
org.jopendocument.dom.template.Template
public class Template
- extends Object
Generates documents merging template and data.
Sample usage:
Template template = new Template(new FileInputStream("template.sxw"));
Map vars = new HashMap();
vars.put("title", "The Title");
//...
template.createDocument(vars, new FileOutputStream("document.sxw"));
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
contentTemplate
protected final Parsed<ODPackage> contentTemplate
Template
public Template(InputStream in)
throws IOException,
TemplateException
- Loads a template from the specified input stream.
- Parameters:
in
- a stream on a ODF package.
- Throws:
IOException
- if the stream can't be read.
TemplateException
- if the template statements are invalid.
Template
public Template(File f)
throws IOException,
TemplateException
- Throws:
IOException
TemplateException
Template
public Template(ODPackage contents)
throws IOException,
TemplateException
- Throws:
IOException
TemplateException
createDocument
public void createDocument(DataModel engine,
OutputStream out)
throws IOException,
TemplateException
- Generates a document merging template and data.
- Parameters:
engine
- the data model.out
- stream the document is written to.
- Throws:
IOException
- si erreur de zippage.
TemplateException
createDocument
public ODSingleXMLDocument createDocument(DataModel engine)
throws TemplateException
- Throws:
TemplateException
Copyright © 2010 jOpenDocument All Rights Reserved.