Class XmlUtil


  • public final class XmlUtil
    extends java.lang.Object
    This class provides utils for XML document management.
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static void addElement​(java.lang.StringBuffer strXmlBuffer, java.lang.String strTag, int nValue)
      Add an element to an XML document buffer.
      static void addElement​(java.lang.StringBuffer strXmlBuffer, java.lang.String strTag, java.lang.String strValue)
      Add an element to an XML document buffer
      static void addElement​(java.lang.StringBuffer strXmlBuffer, java.lang.String strTag, java.lang.String strValue, java.util.Map<?,​?> attrList)
      Add an element to an XML document buffer with attributes
      static void addElementHtml​(java.lang.StringBuffer strXmlBuffer, java.lang.String strTag, java.lang.String strValue)
      Add a CDATA type element to XML document buffer.
      static void addElementHtml​(java.lang.StringBuffer strXmlBuffer, java.lang.String strTag, java.lang.String strValue, java.util.Map<?,​?> attrList)
      Add a CDATA type element to XML document buffer.
      static void addEmptyElement​(java.lang.StringBuffer strXmlBuffer, java.lang.String strTag, java.util.Map<?,​?> attrList)
      Add an empty element (< />) to an XML document buffer.
      static void beginElement​(java.lang.StringBuffer strXmlBuffer, java.lang.String strTag)
      Add an opening tag for an element in a XML document buffer
      static void beginElement​(java.lang.StringBuffer strXmlBuffer, java.lang.String strTag, java.util.Map<?,​?> attrList)
      Add an opening tag for an element in a XML document buffer
      static void endElement​(java.lang.StringBuffer strXmlBuffer, java.lang.String strTag)
      Add a closing tag for an element in a XML document buffer
      static java.lang.String getXmlHeader()
      Gets the header of an XML file
      • Methods inherited from class java.lang.Object

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

      • PROPERTIES_XML_HEADER

        public static final java.lang.String PROPERTIES_XML_HEADER
        See Also:
        Constant Field Values
    • Method Detail

      • getXmlHeader

        public static java.lang.String getXmlHeader()
        Gets the header of an XML file
        Returns:
        The header
      • addElement

        public static void addElement​(java.lang.StringBuffer strXmlBuffer,
                                      java.lang.String strTag,
                                      java.lang.String strValue)
        Add an element to an XML document buffer
        Parameters:
        strXmlBuffer - The XML document buffer
        strTag - The tag name of the element to add
        strValue - The value of the element
      • addEmptyElement

        public static void addEmptyElement​(java.lang.StringBuffer strXmlBuffer,
                                           java.lang.String strTag,
                                           java.util.Map<?,​?> attrList)
        Add an empty element (< />) to an XML document buffer.
        Parameters:
        strXmlBuffer - The XML document buffer
        strTag - The tag name of the element to add
        attrList - The attributes list
      • addElement

        public static void addElement​(java.lang.StringBuffer strXmlBuffer,
                                      java.lang.String strTag,
                                      java.lang.String strValue,
                                      java.util.Map<?,​?> attrList)
        Add an element to an XML document buffer with attributes
        Parameters:
        strXmlBuffer - The XML document buffer
        strTag - The tag name of the element to add
        strValue - The value of the element
        attrList - the attribute list
      • addElement

        public static void addElement​(java.lang.StringBuffer strXmlBuffer,
                                      java.lang.String strTag,
                                      int nValue)
        Add an element to an XML document buffer.
        Parameters:
        strXmlBuffer - The XML document buffer
        strTag - The tag name of the element to add
        nValue - The value of the element
      • addElementHtml

        public static void addElementHtml​(java.lang.StringBuffer strXmlBuffer,
                                          java.lang.String strTag,
                                          java.lang.String strValue)
        Add a CDATA type element to XML document buffer.
        Parameters:
        strXmlBuffer - The XML document buffer
        strTag - The tag name of the element to add
        strValue - The value of the element
      • addElementHtml

        public static void addElementHtml​(java.lang.StringBuffer strXmlBuffer,
                                          java.lang.String strTag,
                                          java.lang.String strValue,
                                          java.util.Map<?,​?> attrList)
        Add a CDATA type element to XML document buffer.
        Parameters:
        strXmlBuffer - The XML document buffer
        strTag - The tag name of the element to add
        strValue - The value of the element
        attrList - The attributes list
      • beginElement

        public static void beginElement​(java.lang.StringBuffer strXmlBuffer,
                                        java.lang.String strTag)
        Add an opening tag for an element in a XML document buffer
        Parameters:
        strXmlBuffer - The XML document buffer
        strTag - The tag name of the element to add
      • beginElement

        public static void beginElement​(java.lang.StringBuffer strXmlBuffer,
                                        java.lang.String strTag,
                                        java.util.Map<?,​?> attrList)
        Add an opening tag for an element in a XML document buffer
        Parameters:
        strXmlBuffer - The XML document buffer
        strTag - The tag name of the element to add
        attrList - The attributes list
      • endElement

        public static void endElement​(java.lang.StringBuffer strXmlBuffer,
                                      java.lang.String strTag)
        Add a closing tag for an element in a XML document buffer
        Parameters:
        strXmlBuffer - The XML document buffer
        strTag - The tag name of the element to add