net.officefloor.plugin.xml.marshall.tree
Class ProxyXmlMapping

java.lang.Object
  extended by net.officefloor.plugin.xml.marshall.tree.ProxyXmlMapping
All Implemented Interfaces:
XmlMapping

public class ProxyXmlMapping
extends Object
implements XmlMapping

Enables wrapping of a XmlWriter to let it be referenced.

Author:
Daniel Sagenschneider

Field Summary
protected  XmlMapping delegate
          XmlMapping being wrapped to delegate XML mapping.
 
Constructor Summary
ProxyXmlMapping()
           
 
Method Summary
 XmlWriter getWriter()
          Obtains the XmlWriter for this mapping.
 void map(Object source, XmlOutput output)
          Maps the object into XML.
 void setDelegate(XmlMapping delegate)
           The creation of XmlMapping (and its XmlWriter) will recursively load its XmlMapping.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

delegate

protected XmlMapping delegate
XmlMapping being wrapped to delegate XML mapping.

Constructor Detail

ProxyXmlMapping

public ProxyXmlMapping()
Method Detail

setDelegate

public void setDelegate(XmlMapping delegate)

The creation of XmlMapping (and its XmlWriter) will recursively load its XmlMapping.

This is therefore necessary to enable a child to reference this in place of the actual parent XmlMapping, as the parent XmlMapping will not be available until all its descendants are created.

Parameters:
delegate - Delegate to do the XML writing.

map

public void map(Object source,
                XmlOutput output)
         throws XmlMarshallException
Description copied from interface: XmlMapping
Maps the object into XML.

Specified by:
map in interface XmlMapping
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 the XmlWriter for this mapping.

Specified by:
getWriter in interface XmlMapping
Returns:
XmlWriter for this mapping.


Copyright © 2005-2013. All Rights Reserved.