Class ObjectWriter
- java.lang.Object
-
- org.pentaho.reporting.engine.classic.core.modules.parser.extwriter.AbstractXMLDefinitionWriter
-
- org.pentaho.reporting.engine.classic.core.modules.parser.extwriter.ObjectWriter
-
- Direct Known Subclasses:
DataSourceWriter
,TemplateWriter
public class ObjectWriter extends AbstractXMLDefinitionWriter
A writer.- Author:
- Thomas Morgner.
-
-
Field Summary
-
Fields inherited from class org.pentaho.reporting.engine.classic.core.modules.parser.extwriter.AbstractXMLDefinitionWriter
BASIC_KEY_TAG, BASIC_OBJECT_TAG, CLASS_ATTRIBUTE, COMPOUND_KEY_TAG, COMPOUND_OBJECT_TAG, CONFIGURATION_TAG, DATASOURCE_TAG, EXTENDS_TAG, FUNCTIONS_TAG, HEIGHT_ATT, NAME_ATTR, OUTPUT_TARGET_TAG, PARSER_CONFIG_TAG, PROPERTIES_TAG, PROPERTY_TAG, REPORT_CONFIG_TAG, REPORT_DEFINITION_TAG, STYLE_TAG, STYLES_TAG, TEMPLATE_TAG, TEMPLATES_TAG, WIDTH_ATT
-
-
Constructor Summary
Constructors Constructor Description ObjectWriter(ReportWriterContext reportWriter, Object baseObject, ObjectDescription objectDescription, org.pentaho.reporting.libraries.xmlns.writer.XmlWriter indentLevel)
Creates a new writer.ObjectWriter(ReportWriterContext reportWriter, ObjectDescription objectDescription, org.pentaho.reporting.libraries.xmlns.writer.XmlWriter indentLevel)
Creates a new object writer for the given object description.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description ClassFactoryCollector
getClassFactoryCollector()
Returns the object factory.ObjectDescription
getObjectDescription()
Returns the object description.protected ObjectDescription
getParameterDescription(String name)
Returns a description of a parameter.protected static ArrayList
getParameterNames(ObjectDescription d)
Returns a list of parameter names.protected static boolean
isBasicObject(List parameters, ObjectDescription od)
Returnstrue
if this is a basic object, andfalse
otherwise.void
write()
Writes the description.protected void
writeParameter(String parameterName)
Writes a parameter to XML.-
Methods inherited from class org.pentaho.reporting.engine.classic.core.modules.parser.extwriter.AbstractXMLDefinitionWriter
getReport, getReportWriter, getXmlWriter, hasPublicDefaultConstructor
-
-
-
-
Constructor Detail
-
ObjectWriter
public ObjectWriter(ReportWriterContext reportWriter, Object baseObject, ObjectDescription objectDescription, org.pentaho.reporting.libraries.xmlns.writer.XmlWriter indentLevel) throws ReportWriterException
Creates a new writer.- Parameters:
reportWriter
- the report writer.baseObject
- the base object (null
not permitted).objectDescription
- the object description (null
not permitted) for the to be written object. The base object will be used to fill the object description parameters.indentLevel
- the current indention level.- Throws:
ReportWriterException
- if no writer could be found for the given baseObject.
-
ObjectWriter
public ObjectWriter(ReportWriterContext reportWriter, ObjectDescription objectDescription, org.pentaho.reporting.libraries.xmlns.writer.XmlWriter indentLevel)
Creates a new object writer for the given object description.- Parameters:
reportWriter
- the report writer used to write the generated description.objectDescription
- the object description that should be written. It is assumed, that the object description is completly initialized for writing.indentLevel
- the current code indention level
-
-
Method Detail
-
getObjectDescription
public ObjectDescription getObjectDescription()
Returns the object description.- Returns:
- The object description.
-
getClassFactoryCollector
public ClassFactoryCollector getClassFactoryCollector()
Returns the object factory.- Returns:
- The object factory.
-
write
public void write() throws IOException, ReportWriterException
Writes the description.- Specified by:
write
in classAbstractXMLDefinitionWriter
- Throws:
IOException
- if there is an I/O problem.ReportWriterException
- if the object could not be written.
-
getParameterDescription
protected ObjectDescription getParameterDescription(String name)
Returns a description of a parameter.- Parameters:
name
- the parameter name.- Returns:
- The description.
-
writeParameter
protected void writeParameter(String parameterName) throws IOException, ReportWriterException
Writes a parameter to XML.- Parameters:
parameterName
- the parameter name.- Throws:
IOException
- if there is an I/O problem.ReportWriterException
- if transforming the report into a stream failed.
-
isBasicObject
protected static boolean isBasicObject(List parameters, ObjectDescription od)
Returnstrue
if this is a basic object, andfalse
otherwise.- Parameters:
parameters
- the parameter.od
- the descriptions.- Returns:
- A boolean.
-
getParameterNames
protected static ArrayList getParameterNames(ObjectDescription d)
Returns a list of parameter names.- Parameters:
d
- the description.- Returns:
- The list.
-
-