Class XMLWriter

java.lang.Object
nl.info.webdav.fromcatalina.XMLWriter

public class XMLWriter extends Object
XMLWriter helper class.
  • Field Details

    • OPENING

      public static final int OPENING
      Opening tag.
      See Also:
    • CLOSING

      public static final int CLOSING
      Closing tag.
      See Also:
    • NO_CONTENT

      public static final int NO_CONTENT
      Element with no content.
      See Also:
    • _buffer

      protected StringBuffer _buffer
      Buffer.
    • _writer

      protected Writer _writer
      Writer.
    • _namespaces

      protected Map<String,String> _namespaces
      Namespaces to be declared in the root element
    • _isRootElement

      protected boolean _isRootElement
      Is true until the root element is written
  • Constructor Details

  • Method Details

    • toString

      public String toString()
      Retrieve generated XML.
      Overrides:
      toString in class Object
      Returns:
      String containing the generated XML
    • writeProperty

      public void writeProperty(String name, String value)
      Write property to the XML.
      Parameters:
      name - Property name
      value - Property value
    • writeProperty

      public void writeProperty(String name)
      Write property to the XML.
      Parameters:
      name - Property name
    • writeElement

      public void writeElement(String name, int type)
      Write an element.
      Parameters:
      name - Element name
      type - Element type
    • writeText

      public void writeText(String text)
      Write text.
      Parameters:
      text - Text to append
    • writeData

      public void writeData(String data)
      Write data.
      Parameters:
      data - Data to append
    • writeXMLHeader

      public void writeXMLHeader()
      Write XML Header.
    • sendData

      public void sendData() throws IOException
      Send data and re-initialize buffer.
      Throws:
      IOException