Overview | Package | Class | Tree | Deprecated | Index | Help
| Apache Tomcat 7.0.29
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## 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
`protected boolean` | `canonical` Canonical output.
`protected PrintWriter` | `out` Print writer.

Constructor Summary
`DOMWriter(boolean canonical)` Default constructor.
`DOMWriter(String encoding, boolean canonical)`
`DOMWriter(Writer writer, boolean canonical)`

Method Summary
`boolean` | `getQualifiedNames()`
`static String` | `getWriterEncoding()`
`static boolean` | `isValidJavaEncoding(String encoding)`
`protected String` | `normalize(String s)` Normalizes the given string.
`void` | `print(Node node)` Prints the specified node, recursively.
`void` | `setQualifiedNames(boolean qualifiedNames)`
`static void` | `setWriterEncoding(String encoding)`
`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

    public DOMWriter(String encoding,
                     boolean canonical)
              throws UnsupportedEncodingException

Throws:
  `UnsupportedEncodingException`

### DOMWriter

    public DOMWriter(boolean canonical)
              throws UnsupportedEncodingException

  Default constructor.

  Throws:
    `UnsupportedEncodingException`

### DOMWriter

    public DOMWriter(Writer writer,
                     boolean canonical)

Method Detail

### getQualifiedNames

    public boolean getQualifiedNames()

### setQualifiedNames

    public void setQualifiedNames(boolean qualifiedNames)

### getWriterEncoding

    public static String getWriterEncoding()

### setWriterEncoding

    public static void setWriterEncoding(String encoding)

### isValidJavaEncoding

    public static boolean isValidJavaEncoding(String encoding)

### 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.

Overview | Package | Class | Tree | Deprecated | Index | Help
| Apache Tomcat 7.0.29
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

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