DOMWriter (Apache Tomcat 7.0.104 API Documentation)

org.apache.catalina.util

## Class DOMWriter

- java.lang.Object
- - org.apache.catalina.util.DOMWriter

-     public class DOMWriter
      extends Object

  A sample DOM writer. This sample program illustrates how to traverse a DOM tree in order to print a document that is parsed.

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `protected boolean` | `canonical` Canonical output.
    `protected PrintWriter` | `out` Print writer.

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `DOMWriter(boolean canonical)` Deprecated. Unused - will be removed in 8.0.x
    `DOMWriter(String encoding, boolean canonical)` Deprecated. Unused - will be removed in 8.0.x
    `DOMWriter(Writer writer, boolean canonical)`

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `boolean` | `getQualifiedNames()` Deprecated. Unused - will be removed in 8.0.x
    `static String` | `getWriterEncoding()`
    `static boolean` | `isValidJavaEncoding(String encoding)` Deprecated. Unused - will be removed in 8.0.x
    `protected String` | `normalize(String s)` Normalizes the given string.
    `void` | `print(Node node)` Prints the specified node, recursively.
    `void` | `setQualifiedNames(boolean qualifiedNames)` Deprecated. Unnecessary - will be removed in 8.0.x
    `static void` | `setWriterEncoding(String encoding)` Deprecated. Unused - will be removed in 8.0.x
    `protected Attr[]` | `sortAttributes(NamedNodeMap attrs)` Returns a sorted list of attributes.

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

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

- - ### Field Detail

    - #### out

          protected PrintWriter out

      Print writer.

    - #### canonical

          protected boolean canonical

      Canonical output.

  - ### Constructor Detail

    - #### DOMWriter

          @Deprecated
          public DOMWriter(String encoding,
                              boolean canonical)
                    throws UnsupportedEncodingException

      Deprecated. Unused - will be removed in 8.0.x
      Throws:
        `UnsupportedEncodingException`

    - #### DOMWriter

          @Deprecated
          public DOMWriter(boolean canonical)
                    throws UnsupportedEncodingException

      Deprecated. Unused - will be removed in 8.0.x
      Default constructor.
      Throws:
        `UnsupportedEncodingException`

    - #### DOMWriter

          public DOMWriter(Writer writer,
                   boolean canonical)

  - ### Method Detail

    - #### getQualifiedNames

          @Deprecated
          public boolean getQualifiedNames()

      Deprecated. Unused - will be removed in 8.0.x

    - #### setQualifiedNames

          @Deprecated
          public void setQualifiedNames(boolean qualifiedNames)

      Deprecated. Unnecessary - will be removed in 8.0.x

    - #### getWriterEncoding

          public static String getWriterEncoding()

    - #### setWriterEncoding

          @Deprecated
          public static void setWriterEncoding(String encoding)

      Deprecated. Unused - will be removed in 8.0.x

    - #### isValidJavaEncoding

          @Deprecated
          public static boolean isValidJavaEncoding(String encoding)

      Deprecated. Unused - will be removed in 8.0.x

    - #### print

          public void print(Node node)

      Prints the specified node, recursively.

    - #### sortAttributes

          protected Attr[] sortAttributes(NamedNodeMap attrs)

      Returns a sorted list of attributes.

    - #### normalize

          protected String normalize(String s)

      Normalizes the given string.

Copyright © 2000-2020 Apache Software Foundation. All Rights Reserved.