Class XmlSerializer


  • public class XmlSerializer
    extends Object
    This class defines the methods for serializing an object to XML
    • Constructor Detail

      • XmlSerializer

        public XmlSerializer()
    • Method Detail

      • indent

        public static String indent​(int indent)
        Return indent spaces.
        Parameters:
        indent - number of indentation.
        Returns:
        the indent space string.
      • xmlElement

        public static String xmlElement​(String value,
                                        String xmlTag,
                                        int indent)
        Return the xml representation of the specified value with the root-element xmlTag
        Parameters:
        value - String value to represent in XML
        xmlTag - tag of the root-element
        indent - indent to use
        Returns:
        xml representation of the specified value
      • xmlAttribute

        public static String xmlAttribute​(String value,
                                          String xmlTag)
        Return the xml representation of the specified attribute value
        Parameters:
        value - String value to represent in XML
        xmlTag - tag of the attribute
        Returns:
        xml representation of the specified value