Enhydra 3.0.3 API

org.enhydra.xml.io
Class DOMFormatter

java.lang.Object
  |
  +--org.enhydra.xml.io.DOMFormatter

public class DOMFormatter
extends java.lang.Object

Class for formatting DOMs into a documents. The class handles XML and HTML pages, looking up the approriate formatting routines based on the document type. It has an associated OutputOptions object that controls the formatting. Instances are reusable and multithreaded.


Constructor Summary
DOMFormatter()
          Construct a new XML formatter with default output options.
DOMFormatter(OutputOptions outputOptions)
          Construct a new XML formatter with the specified output options.
 
Method Summary
 OutputOptions getOutputOptions()
          Get the output options.
 void setOutputOptions(OutputOptions outputOptions)
          Set the output options.
 byte[] toBytes(Node node)
          Format a document or any node and its children into a byte array using the current encoding.
 java.lang.String toString(Node node)
          Format a document or any node and its children into a string.
 void write(Node node, java.io.File out)
          Output a document or any node and its children to a File.
 void write(Node node, java.io.OutputStream out)
          Output a document or any node and its children to a OutputStream.
 void write(Node node, java.io.Writer writer)
          Output a document or any node and its children to a Writer.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DOMFormatter

public DOMFormatter(OutputOptions outputOptions)
Construct a new XML formatter with the specified output options.
Parameters:
outputOptions - The OutputOptions object that

DOMFormatter

public DOMFormatter()
Construct a new XML formatter with default output options.
Method Detail

getOutputOptions

public OutputOptions getOutputOptions()
Get the output options.

setOutputOptions

public void setOutputOptions(OutputOptions outputOptions)
Set the output options.

toString

public java.lang.String toString(Node node)
Format a document or any node and its children into a string.

toBytes

public byte[] toBytes(Node node)
               throws java.io.IOException
Format a document or any node and its children into a byte array using the current encoding.

write

public void write(Node node,
                  java.io.Writer writer)
           throws java.io.IOException
Output a document or any node and its children to a Writer.

write

public void write(Node node,
                  java.io.OutputStream out)
           throws java.io.IOException
Output a document or any node and its children to a OutputStream.

write

public void write(Node node,
                  java.io.File out)
           throws java.io.IOException
Output a document or any node and its children to a File.

Enhydra 3.0.3 API