de.vc.xml

## Class XMLWriter

- java.lang.Object
- - de.vc.xml.XMLWriter

-     public class XMLWriter
      extends java.lang.Object

  Writer for XML-Nodes.

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `XMLWriter(java.io.OutputStream output)` Creates a new XML writer for the given output stream.
    `XMLWriter(java.io.OutputStream output, java.lang.String encoding)` Creates a new XML writer for the given output stream and with the given encoding.
    `XMLWriter(java.io.Writer output)` Deprecated. Use XMLWriter(OutputStream)
    `XMLWriter(java.io.Writer output, boolean indenting)` Deprecated. Use XMLWriter(OutputStream)
    `XMLWriter(java.io.Writer output, boolean indenting, java.lang.String xmlVersion)` Deprecated. Use XMLWriter(OutputStream)
    `XMLWriter(java.io.Writer output, java.lang.String xmlVersion)` Deprecated. Use XMLWriter(OutputStream)

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `close()` Closes all open tags and finally the java.io.Writer.
    `void` | `closeTag()` Closes current open tag.
    `void` | `comment(java.lang.String comment)` Insert a comment.
    `void` | `excludeFromFormat(java.lang.String str)`
    `boolean` | `isFormatOutput()`
    `boolean` | `isWriteHeader()`
    `void` | `newLine()` Inserts a new line.
    `void` | `openAndCloseTag(java.lang.String tag)` Opens and closes a tag (empty tag).
    `void` | `openAndCloseTag(java.lang.String tag, java.util.Map<java.lang.String,?> attributes)` Opens and closes a tag (empty tag) with some attributes..
    `void` | `openTag(java.lang.String tag)` Opens a XML-tag.
    `void` | `openTag(java.lang.String tag, java.util.Map<java.lang.String,?> attributes)` Open a XML-tag with some attributes.
    `void` | `setFormatOutput(boolean format)`
    `void` | `setWriteHeader(boolean writeHeader)`
    `void` | `write(java.util.List<?> elements)` Writes a List of NodeElements.
    `void` | `write(NodeElement element)` Writes a NodeElement.
    `void` | `write(NodeElement[] elements)` Writes a List of NodeElements.
    `protected void` | `writeHeader()`
    `void` | `writePCData(java.lang.String data)` Writes PCData.

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Constructor Detail

    - #### XMLWriter

          public XMLWriter(java.io.Writer output)

      Deprecated. Use XMLWriter(OutputStream)
      Constructs a XML-Writer.
      XML-Version is 1.0
      Indenting is false.
      Parameters:
        `output` - Writer.

    - #### XMLWriter

          public XMLWriter(java.io.Writer output,
                   boolean indenting)

      Deprecated. Use XMLWriter(OutputStream)
      Constructs a XML-Writer.
      XML-Version is 1.0.
      Parameters:
        `output` - Writer.
        `indenting` - true, if indenting.

    - #### XMLWriter

          public XMLWriter(java.io.Writer output,
                   java.lang.String xmlVersion)

      Deprecated. Use XMLWriter(OutputStream)
      Constructs a XML-Writer.
      Indenting is false.
      Parameters:
        `output` - Writer.
        `xmlVersion` - XML-Version.

    - #### XMLWriter

          public XMLWriter(java.io.Writer output,
                   boolean indenting,
                   java.lang.String xmlVersion)

      Deprecated. Use XMLWriter(OutputStream)
      Constructs a XML-Writer.
      Parameters:
        `output` - Writer.
        `indenting` - true, if indenting.
        `xmlVersion` - XML-Version.

    - #### XMLWriter

          public XMLWriter(java.io.OutputStream output)
                    throws java.io.IOException

      Creates a new XML writer for the given output stream.
      Parameters:
        `output` - Output Stream
      Throws:
        `java.io.IOException`

    - #### XMLWriter

          public XMLWriter(java.io.OutputStream output,
                   java.lang.String encoding)
                    throws java.io.IOException

      Creates a new XML writer for the given output stream and with the given encoding.
      Parameters:
        `output` - Output Stream
        `encoding` - Encoding (e.g. UTF-8, ISO-8859-1)
      Throws:
        `java.io.IOException`

  - ### Method Detail

    - #### close

          public void close()

      Closes all open tags and finally the java.io.Writer.

    - #### closeTag

          public void closeTag()

      Closes current open tag.

    - #### comment

          public void comment(java.lang.String comment)

      Insert a comment.
      Parameters:
        `comment` - Comment.

    - #### excludeFromFormat

          public void excludeFromFormat(java.lang.String str)

    - #### newLine

          public void newLine()

      Inserts a new line.

    - #### openAndCloseTag

          public void openAndCloseTag(java.lang.String tag)

      Opens and closes a tag (empty tag).
      Parameters:
        `tag` - XML-tag.

    - #### openAndCloseTag

          public void openAndCloseTag(java.lang.String tag,
                             java.util.Map<java.lang.String,?> attributes)

      Opens and closes a tag (empty tag) with some attributes..
      Parameters:
        `tag` - XML-tag.
        `attributes` - Map of attributes.

    - #### openTag

          public void openTag(java.lang.String tag)

      Opens a XML-tag.
      Parameters:
        `tag` - XML-tag.

    - #### openTag

          public void openTag(java.lang.String tag,
                     java.util.Map<java.lang.String,?> attributes)

      Open a XML-tag with some attributes.
      Parameters:
        `tag` - XML-tag
        `attributes` - Map of attributes.

    - #### write

          public void write(java.util.List<?> elements)

      Writes a List of NodeElements.
      Parameters:
        `elements` - Elements.

    - #### write

          public void write(NodeElement element)

      Writes a NodeElement.
      Parameters:
        `element` - NodeElement.

    - #### write

          public void write(NodeElement[] elements)

      Writes a List of NodeElements.
      Parameters:
        `elements` - Elements.

    - #### writePCData

          public void writePCData(java.lang.String data)

      Writes PCData.
      Parameters:
        `data` - PCData.

    - #### writeHeader

          protected void writeHeader()

    - #### isFormatOutput

          public boolean isFormatOutput()

    - #### isWriteHeader

          public boolean isWriteHeader()

    - #### setWriteHeader

          public void setWriteHeader(boolean writeHeader)

    - #### setFormatOutput

          public void setFormatOutput(boolean format)

© 2003-2011 by Sascha Schmidt (vision-cloud.de). All Rights Reserved.