Class AbstractValueXmlMapping

    • Field Summary

      Fields 
      Modifier and Type Field Description
      protected boolean isUseRaw
      Indicates whether the substitution of special characters of XML should not occur.
      protected java.lang.String tagName
      Name of attribute/value.
      protected Translator translator
      Translator to translate the return value of the method to a string value for XML.
    • Constructor Summary

      Constructors 
      Constructor Description
      AbstractValueXmlMapping​(java.lang.String tagName, java.lang.reflect.Method getMethod, Translator translator, boolean isUseRaw)
      Initiate with items to write an attribute/value.
    • Method Summary

      All Methods Instance Methods Abstract Methods Concrete Methods 
      Modifier and Type Method Description
      void writeXml​(java.lang.Object value, XmlOutput output)
      Writes the XML for the input object.
      protected abstract void writeXml​(java.lang.String tagName, java.lang.String value, XmlOutput output)
      Writes the XML.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • tagName

        protected final java.lang.String tagName
        Name of attribute/value.
      • translator

        protected final Translator translator
        Translator to translate the return value of the method to a string value for XML.
      • isUseRaw

        protected final boolean isUseRaw
        Indicates whether the substitution of special characters of XML should not occur.
    • Constructor Detail

      • AbstractValueXmlMapping

        public AbstractValueXmlMapping​(java.lang.String tagName,
                                       java.lang.reflect.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 Detail

      • writeXml

        public void writeXml​(java.lang.Object value,
                             XmlOutput output)
                      throws XmlMarshallException
        Description copied from interface: XmlWriter
        Writes 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​(java.lang.String tagName,
                                         java.lang.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.