org.apache.jorphan.util

## Class XMLBuffer

- java.lang.Object
- - org.apache.jorphan.util.XMLBuffer

-     public class XMLBuffer
      extends java.lang.Object

  Provides XML string building methods. Not synchronised.

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `XMLBuffer()`

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `XMLBuffer` | `closeTag(java.lang.String tagName)` Close top tag from stack.
    `XMLBuffer` | `openTag(java.lang.String tagName)` Open a tag; save on stack.
    `XMLBuffer` | `tag(java.lang.String tagName, java.lang.CharSequence content)` Add a complete tag with content.
    `java.lang.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, wait, wait, wait`

- - ### Constructor Detail

    - #### XMLBuffer

          public XMLBuffer()

  - ### Method Detail

    - #### openTag

          public XMLBuffer openTag(java.lang.String tagName)

      Open a tag; save on stack.
      Parameters:
        `tagName` - name of the tag
      Returns:
        this

    - #### closeTag

          public XMLBuffer closeTag(java.lang.String tagName)

      Close top tag from stack.
      Parameters:
        `tagName` - name of the tag to close
      Returns:
        this
      Throws:
        `java.lang.IllegalArgumentException` - if the tag names do not match

    - #### tag

          public XMLBuffer tag(java.lang.String tagName,
                               java.lang.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

          public java.lang.String toString()

      Convert the buffer to a string, closing any open tags
      Overrides:
        `toString` in class `java.lang.Object`

Copyright © 1998-2018 Apache Software Foundation. All Rights Reserved.