Class TreeXmlMarshaller
java.lang.Object
net.officefloor.plugin.xml.marshall.tree.TreeXmlMarshaller
- All Implemented Interfaces:
XmlMapping,XmlWriter,XmlMarshaller
Implementation of
XmlMarshaller that is
capable of marshalling a tree object graph.- Author:
- Daniel Sagenschneider
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected final XmlContextXmlContextto handle the root object. -
Constructor Summary
ConstructorsConstructorDescriptionTreeXmlMarshaller(XmlMappingMetaData metaData, TranslatorRegistry translatorRegistry, ReferencedXmlMappingRegistry referenceRegistry) Initiate with details to marshall the object. -
Method Summary
Modifier and TypeMethodDescriptionObtains theXmlWriterfor this mapping.voidMaps the object into XML.voidMarshalls the source object as XML to the output.voidWrites the XML for the input object.
-
Field Details
-
context
XmlContextto handle the root object.
-
-
Constructor Details
-
TreeXmlMarshaller
public TreeXmlMarshaller(XmlMappingMetaData metaData, TranslatorRegistry translatorRegistry, ReferencedXmlMappingRegistry referenceRegistry) throws XmlMarshallException Initiate with details to marshall the object.- Parameters:
metaData- Meta-data of the mappings.translatorRegistry- Registry ofTranslatorinstances for marshalling values.referenceRegistry- RegistryXmlMappingthat may be referenced.- Throws:
XmlMarshallException- If fail to configure.
-
-
Method Details
-
marshall
Description copied from interface:XmlMarshallerMarshalls the source object as XML to the output.- Specified by:
marshallin interfaceXmlMarshaller- Parameters:
source- Object to marshall into XML.output- Output to send the XML.- Throws:
XmlMarshallException- If fails to marshall source.
-
map
Description copied from interface:XmlMappingMaps the object into XML.- Specified by:
mapin interfaceXmlMapping- Parameters:
object- Object to map into XML.output- Output to send the XML.- Throws:
XmlMarshallException- If fails to map object into XML.
-
getWriter
Description copied from interface:XmlMappingObtains theXmlWriterfor this mapping.- Specified by:
getWriterin interfaceXmlMapping- Returns:
XmlWriterfor this mapping.
-
writeXml
Description copied from interface:XmlWriterWrites the XML for the input object.- Specified by:
writeXmlin interfaceXmlWriter- Parameters:
object- Object to have XML written for it.output- Output to write the XML.- Throws:
XmlMarshallException- If fails to write the object into XML.
-