com.jrefinery.report.io.ext.writer
Class ObjectWriter

java.lang.Object
  |
  +--com.jrefinery.report.io.ext.writer.AbstractXMLDefinitionWriter
        |
        +--com.jrefinery.report.io.ext.writer.ObjectWriter
Direct Known Subclasses:
DataSourceWriter

public class ObjectWriter
extends AbstractXMLDefinitionWriter

A writer.

Author:
Thomas Morgner.

Field Summary
 
Fields inherited from class com.jrefinery.report.io.ext.writer.AbstractXMLDefinitionWriter
CLOSE, CLOSE_TAG_DECREASE, INDENT_ONLY, OPEN, OPEN_TAG_INCREASE
 
Constructor Summary
ObjectWriter(ReportWriter reportWriter, java.lang.Object baseObject, org.jfree.xml.factory.objects.ObjectDescription objectDescription, int indentLevel)
          Creates a new writer.
 
Method Summary
 java.lang.Object getBaseObject()
          Returns the base object.
 org.jfree.xml.factory.objects.ClassFactoryCollector getClassFactoryCollector()
          Returns the object factory.
 org.jfree.xml.factory.objects.ObjectDescription getObjectDescription()
          Returns the object description.
protected  org.jfree.xml.factory.objects.ObjectDescription getParameterDescription(java.lang.String name)
          Returns a description of a parameter.
protected static java.util.ArrayList getParameterNames(org.jfree.xml.factory.objects.ObjectDescription d)
          Returns a list of parameter names.
protected static boolean isBasicObject(java.util.List parameters, org.jfree.xml.factory.objects.ObjectDescription od)
          Returns true if this is a basic object, and false otherwise.
 void write(java.io.Writer writer)
          Writes the description.
protected  void writeParameter(java.io.Writer writer, java.lang.String parameterName)
          Writes a parameter to XML.
 
Methods inherited from class com.jrefinery.report.io.ext.writer.AbstractXMLDefinitionWriter
decreaseIndent, getIndentLevel, getLineSeparator, getReport, getReportWriter, getSafeTags, increaseIndent, indent, normalize, writeCloseTag, writeTag, writeTag, writeTag
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ObjectWriter

public ObjectWriter(ReportWriter reportWriter,
                    java.lang.Object baseObject,
                    org.jfree.xml.factory.objects.ObjectDescription objectDescription,
                    int indentLevel)
Creates a new writer.

Parameters:
reportWriter - the report writer.
baseObject - the base object (null not permitted).
objectDescription - the object description (null not permitted).
indentLevel - the current indention level.
Method Detail

getObjectDescription

public org.jfree.xml.factory.objects.ObjectDescription getObjectDescription()
Returns the object description.

Returns:
The object description.

getBaseObject

public java.lang.Object getBaseObject()
Returns the base object.

Returns:
The base object.

getClassFactoryCollector

public org.jfree.xml.factory.objects.ClassFactoryCollector getClassFactoryCollector()
Returns the object factory.

Returns:
The object factory.

write

public void write(java.io.Writer writer)
           throws java.io.IOException,
                  ReportWriterException
Writes the description.

Specified by:
write in class AbstractXMLDefinitionWriter
Parameters:
writer - the writer.
Throws:
java.io.IOException - if there is an I/O problem.
ReportWriterException - if the object could not be written.

getParameterDescription

protected org.jfree.xml.factory.objects.ObjectDescription getParameterDescription(java.lang.String name)
Returns a description of a parameter.

Parameters:
name - the parameter name.
Returns:
The description.

writeParameter

protected void writeParameter(java.io.Writer writer,
                              java.lang.String parameterName)
                       throws java.io.IOException,
                              ReportWriterException
Writes a parameter to XML.

Parameters:
writer - the writer.
parameterName - the parameter name.
Throws:
java.io.IOException - if there is an I/O problem.
ReportWriterException - if transforming the report into a stream failed.

isBasicObject

protected static boolean isBasicObject(java.util.List parameters,
                                       org.jfree.xml.factory.objects.ObjectDescription od)
Returns true if this is a basic object, and false otherwise.

Parameters:
parameters - the parameter.
od - the descriptions.
Returns:
A boolean.

getParameterNames

protected static java.util.ArrayList getParameterNames(org.jfree.xml.factory.objects.ObjectDescription d)
Returns a list of parameter names.

Parameters:
d - the description.
Returns:
The list.