Class ProxyXmlMapping
- java.lang.Object
-
- net.officefloor.plugin.xml.marshall.tree.ProxyXmlMapping
-
- All Implemented Interfaces:
XmlMapping
public class ProxyXmlMapping extends java.lang.Object implements XmlMapping
Enables wrapping of aXmlWriter
to let it be referenced.- Author:
- Daniel Sagenschneider
-
-
Field Summary
Fields Modifier and Type Field Description protected XmlMapping
delegate
XmlMapping
being wrapped to delegate XML mapping.
-
Constructor Summary
Constructors Constructor Description ProxyXmlMapping()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description XmlWriter
getWriter()
Obtains theXmlWriter
for this mapping.void
map(java.lang.Object source, XmlOutput output)
Maps the object into XML.void
setDelegate(XmlMapping delegate)
-
-
-
Field Detail
-
delegate
protected XmlMapping delegate
XmlMapping
being wrapped to delegate XML mapping.
-
-
Method Detail
-
setDelegate
public void setDelegate(XmlMapping delegate)
The creation of
XmlMapping
(and itsXmlWriter
) will recursively load itsXmlMapping
.This is therefore necessary to enable a child to reference this in place of the actual parent
XmlMapping
, as the parentXmlMapping
will not be available until all its descendants are created.- Parameters:
delegate
- Delegate to do the XML writing.
-
map
public void map(java.lang.Object source, XmlOutput output) throws XmlMarshallException
Description copied from interface:XmlMapping
Maps the object into XML.- Specified by:
map
in interfaceXmlMapping
- Parameters:
source
- Object to map into XML.output
- Output to send the XML.- Throws:
XmlMarshallException
- If fails to map object into XML.
-
getWriter
public XmlWriter getWriter()
Description copied from interface:XmlMapping
Obtains theXmlWriter
for this mapping.- Specified by:
getWriter
in interfaceXmlMapping
- Returns:
XmlWriter
for this mapping.
-
-