org.jfree.report.modules.parser.extwriter
Class TemplateWriter

java.lang.Object
  extended byorg.jfree.xml.writer.XMLWriterSupport
      extended byorg.jfree.report.modules.parser.extwriter.AbstractXMLDefinitionWriter
          extended byorg.jfree.report.modules.parser.extwriter.ObjectWriter
              extended byorg.jfree.report.modules.parser.extwriter.TemplateWriter

public class TemplateWriter
extends ObjectWriter

The template writer writes a single template definition to the xml-definition stream. This writer requires report builder hints to be present for all templates.

Author:
Thomas Morgner

Field Summary
 
Fields inherited from class org.jfree.xml.writer.XMLWriterSupport
CLOSE, CLOSE_TAG_DECREASE, INDENT_ONLY, OPEN, OPEN_TAG_INCREASE
 
Constructor Summary
TemplateWriter(ReportWriter reportWriter, int indentLevel, TemplateDescription template, TemplateDescription parent, CommentHintPath path)
          Creates a new template writer.
 
Method Summary
 void write(java.io.Writer writer)
          Writes the report definition portion.
 
Methods inherited from class org.jfree.report.modules.parser.extwriter.ObjectWriter
getClassFactoryCollector, getCommentHintPath, getObjectDescription, getParameterDescription, getParameterNames, isBasicObject, writeParameter
 
Methods inherited from class org.jfree.report.modules.parser.extwriter.AbstractXMLDefinitionWriter
getDefaultSafeTags, getReport, getReportWriter, normalize, writeComment, writeComment
 
Methods inherited from class org.jfree.xml.writer.XMLWriterSupport
allowLineBreak, decreaseIndent, endBlock, getIndentLevel, getLineSeparator, getSafeTags, increaseIndent, indent, startBlock, writeCloseTag, writeTag, writeTag, writeTag, writeTag
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TemplateWriter

public TemplateWriter(ReportWriter reportWriter,
                      int indentLevel,
                      TemplateDescription template,
                      TemplateDescription parent,
                      CommentHintPath path)
Creates a new template writer.

Parameters:
reportWriter - the report writer that is used to coordinate the writing.
indentLevel - the current indention level.
template - the template that should be written.
parent - the parent of the template.
path - the comment hint path used to resolve xml-comments from the parser.
Method Detail

write

public void write(java.io.Writer writer)
           throws java.io.IOException,
                  ReportWriterException
Writes the report definition portion. Every DefinitionWriter handles one or more elements of the JFreeReport object tree, DefinitionWriter traverse the object tree and write the known objects or forward objects to other definition writers.

Overrides:
write in class ObjectWriter
Parameters:
writer - the writer.
Throws:
java.io.IOException - if there is an I/O problem.
ReportWriterException - if the report serialisation failed.