Class ReferenceXmlMapping
- java.lang.Object
-
- net.officefloor.plugin.xml.marshall.tree.ReferenceXmlMapping
-
- All Implemented Interfaces:
XmlMapping
public class ReferenceXmlMapping extends java.lang.Object implements XmlMapping
Enables referencing anotherXmlWriter
to write the XML of the object obtained from the source object.- Author:
- Daniel Sagenschneider
-
-
Field Summary
Fields Modifier and Type Field Description protected XmlMapping
delegate
XmlMapping
being wrapped to delegate XML writing.protected java.lang.String
getMethodName
Name of method to obtain object to write as XML.protected java.util.Map<java.lang.Class<?>,java.lang.reflect.Method>
methods
Methods specific to a class.
-
Constructor Summary
Constructors Constructor Description ReferenceXmlMapping(java.lang.reflect.Method getMethod, XmlMapping delegate)
Initiate to apply reference mapping.
-
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.
-
-
-
Field Detail
-
getMethodName
protected final java.lang.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 java.util.Map<java.lang.Class<?>,java.lang.reflect.Method> methods
Methods specific to a class.
-
-
Constructor Detail
-
ReferenceXmlMapping
public ReferenceXmlMapping(java.lang.reflect.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 theXmlWriter
to write the XML.
-
-
Method Detail
-
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.
-
-