public class ObjectWriter extends 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 and Description |
---|
ObjectWriter(ReportWriterContext reportWriter,
ObjectDescription objectDescription,
XmlWriter indentLevel)
Creates a new object writer for the given object description.
|
ObjectWriter(ReportWriterContext reportWriter,
Object baseObject,
ObjectDescription objectDescription,
XmlWriter indentLevel)
Creates a new writer.
|
Modifier and Type | Method and 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)
Returns
true if this is a basic object, and false otherwise. |
void |
write()
Writes the description.
|
protected void |
writeParameter(String parameterName)
Writes a parameter to XML.
|
getReport, getReportWriter, getXmlWriter, hasPublicDefaultConstructor
public ObjectWriter(ReportWriterContext reportWriter, Object baseObject, ObjectDescription objectDescription, XmlWriter indentLevel) throws ReportWriterException
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.ReportWriterException
- if no writer could be found for the given baseObject.public ObjectWriter(ReportWriterContext reportWriter, ObjectDescription objectDescription, XmlWriter indentLevel)
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 levelpublic ObjectDescription getObjectDescription()
public ClassFactoryCollector getClassFactoryCollector()
public void write() throws IOException, ReportWriterException
write
in class AbstractXMLDefinitionWriter
IOException
- if there is an I/O problem.ReportWriterException
- if the object could not be written.protected ObjectDescription getParameterDescription(String name)
name
- the parameter name.protected void writeParameter(String parameterName) throws IOException, ReportWriterException
parameterName
- the parameter name.IOException
- if there is an I/O problem.ReportWriterException
- if transforming the report into a stream failed.protected static boolean isBasicObject(List parameters, ObjectDescription od)
true
if this is a basic object, and false
otherwise.parameters
- the parameter.od
- the descriptions.protected static ArrayList getParameterNames(ObjectDescription d)
d
- the description.Copyright © 2017 Hitachi Vantara. All rights reserved.