Class XMLBuffer

  • All Implemented Interfaces:

    
    public class XMLBuffer
    
                        

    Provides XML string building methods. Not synchronised.

    • Nested Class Summary

      Nested Classes 
      Modifier and Type Class Description
    • Field Summary

      Fields 
      Modifier and Type Field Description
    • Constructor Summary

      Constructors 
      Constructor Description
      XMLBuffer()
    • Enum Constant Summary

      Enum Constants 
      Enum Constant Description
    • Method Summary

      Modifier and Type Method Description
      XMLBuffer openTag(String tagName) Open a tag; save on stack.
      XMLBuffer closeTag(String tagName) Close top tag from stack.
      XMLBuffer tag(String tagName, CharSequence content) Add a complete tag with content.
      String toString() Convert the buffer to a string, closing any open tags
      • Methods inherited from class java.lang.Object

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

      • XMLBuffer

        XMLBuffer()
    • Method Detail

      • openTag

         XMLBuffer openTag(String tagName)

        Open a tag; save on stack.

        Parameters:
        tagName - name of the tag
        Returns:

        this

      • closeTag

         XMLBuffer closeTag(String tagName)

        Close top tag from stack.

        Parameters:
        tagName - name of the tag to close
        Returns:

        this

      • tag

         XMLBuffer tag(String tagName, CharSequence content)

        Add a complete tag with content.

        Parameters:
        tagName - name of the tag
        content - content to put in tag, or empty content, if an empty tag should be used
        Returns:

        this

      • toString

         String toString()

        Convert the buffer to a string, closing any open tags