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

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

public class ReferenceXmlMapping
extends Object
implements XmlMapping

Enables referencing another XmlWriter to write the XML of the object obtained from the source object.

Author:
Daniel Sagenschneider

Field Summary
protected  XmlMapping delegate
          XmlMapping being wrapped to delegate XML writing.
protected  String getMethodName
          Name of method to obtain object to write as XML.
protected  Map<Class<?>,Method> methods
          Methods specific to a class.
 
Constructor Summary
ReferenceXmlMapping(Method getMethod, XmlMapping delegate)
          Initiate to apply reference mapping.
 
Method Summary
 XmlWriter getWriter()
          Obtains the XmlWriter for this mapping.
 void map(Object source, XmlOutput output)
          Maps the object into XML.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

getMethodName

protected final String getMethodName
Name of method to obtain object to write as XML.


delegate

protected final XmlMapping delegate
XmlMapping being wrapped to delegate XML writing.


methods

protected final Map<Class<?>,Method> methods
Methods specific to a class.

Constructor Detail

ReferenceXmlMapping

public ReferenceXmlMapping(Method getMethod,
                           XmlMapping delegate)
Initiate to apply reference mapping.

Parameters:
getMethod - Method to obtain object to apply reference from upper bound type of source object.
delegate - Delgate to object the XmlWriter to write the XML.
Method Detail

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.