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 anotherXmlWriterto write the XML of the object obtained from the source object.- Author:
- Daniel Sagenschneider
-
-
Field Summary
Fields Modifier and Type Field Description protected XmlMappingdelegateXmlMappingbeing wrapped to delegate XML writing.protected java.lang.StringgetMethodNameName of method to obtain object to write as XML.protected java.util.Map<java.lang.Class<?>,java.lang.reflect.Method>methodsMethods 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 XmlWritergetWriter()Obtains theXmlWriterfor this mapping.voidmap(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
XmlMappingbeing 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 theXmlWriterto write the XML.
-
-
Method Detail
-
map
public void map(java.lang.Object source, XmlOutput output) throws XmlMarshallExceptionDescription copied from interface:XmlMappingMaps the object into XML.- Specified by:
mapin 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:XmlMappingObtains theXmlWriterfor this mapping.- Specified by:
getWriterin interfaceXmlMapping- Returns:
XmlWriterfor this mapping.
-
-