Class AbstractValueXmlMapping
java.lang.Object
net.officefloor.plugin.xml.marshall.tree.AbstractXmlMapping
net.officefloor.plugin.xml.marshall.tree.AbstractValueXmlMapping
- All Implemented Interfaces:
XmlMapping,XmlWriter
- Direct Known Subclasses:
AttributeXmlMapping,ValueXmlMapping
Abstract
XmlMapping to aid
in writing an attribute/value.- Author:
- Daniel Sagenschneider
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected final booleanIndicates whether the substitution of special characters of XML should not occur.protected final StringName of attribute/value.protected final TranslatorTranslatorto translate the return value of the method to a string value for XML.Fields inherited from class net.officefloor.plugin.xml.marshall.tree.AbstractXmlMapping
getMethod -
Constructor Summary
ConstructorsConstructorDescriptionAbstractValueXmlMapping(String tagName, Method getMethod, Translator translator, boolean isUseRaw) Initiate with items to write an attribute/value. -
Method Summary
Methods inherited from class net.officefloor.plugin.xml.marshall.tree.AbstractXmlMapping
getWriter, map
-
Field Details
-
tagName
Name of attribute/value. -
translator
Translatorto translate the return value of the method to a string value for XML. -
isUseRaw
protected final boolean isUseRawIndicates whether the substitution of special characters of XML should not occur.
-
-
Constructor Details
-
AbstractValueXmlMapping
public AbstractValueXmlMapping(String tagName, Method getMethod, Translator translator, boolean isUseRaw) Initiate with items to write an attribute/value.- Parameters:
tagName- Name of attribute/value.getMethod- Method to obtain value from object.translator- Translates the object to string value for XML.isUseRaw- Indicates not to substitute special characters of XML and use raw translated value.
-
-
Method Details
-
writeXml
Description copied from interface:XmlWriterWrites the XML for the input object.- Parameters:
value- Object to have XML written for it.output- Output to write the XML.- Throws:
XmlMarshallException- If fails to write the object into XML.
-
writeXml
protected abstract void writeXml(String tagName, String value, XmlOutput output) throws XmlMarshallException Writes the XML.- Parameters:
tagName- Tag name for writing XML snippet.value- Value of XML snippet.output- Output to send the XML snippet.- Throws:
XmlMarshallException- If fails to write XML.
-