DOMWriter (Apache Tomcat 8.5.55 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` Deprecated. Will be made private in Tomcat 9.
    `protected PrintWriter` | `out` Deprecated. Will be made private in Tomcat 9.

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `DOMWriter(Writer writer)`
    `DOMWriter(Writer writer, boolean canonical)` Deprecated.

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `static String` | `getWriterEncoding()` Deprecated. Unused. Will be removed in Tomcat 9.
    `protected String` | `normalize(String s)` Deprecated. Will be made private in Tomcat 9.
    `void` | `print(Node node)` Prints the specified node, recursively.
    `protected Attr[]` | `sortAttributes(NamedNodeMap attrs)` Deprecated. Will be made private in Tomcat 9.

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

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

- - ### Field Detail

    - #### out

          @Deprecated
          protected final PrintWriter out

      Deprecated. Will be made private in Tomcat 9.
      Print writer.

    - #### canonical

          @Deprecated
          protected final boolean canonical

      Deprecated. Will be made private in Tomcat 9.
      Canonical output.

  - ### Constructor Detail

    - #### DOMWriter

          public DOMWriter(Writer writer)

    - #### DOMWriter

          @Deprecated
          public DOMWriter(Writer writer,
                              boolean canonical)

      Deprecated.

  - ### Method Detail

    - #### getWriterEncoding

          @Deprecated
          public static String getWriterEncoding()

      Deprecated. Unused. Will be removed in Tomcat 9.
      Returns:
        Always `UTF-8`

    - #### print

          public void print(Node node)

      Prints the specified node, recursively.
      Parameters:
        `node` - The node to output

    - #### sortAttributes

          @Deprecated
          protected Attr[] sortAttributes(NamedNodeMap attrs)

      Deprecated. Will be made private in Tomcat 9.
      Returns a sorted list of attributes.
      Parameters:
        `attrs` - The map to sort
      Returns:
        a sorted attribute array

    - #### normalize

          @Deprecated
          protected String normalize(String s)

      Deprecated. Will be made private in Tomcat 9.
      Normalizes the given string.
      Parameters:
        `s` - The string to escape
      Returns:
        the escaped string

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