org.enhydra.xml.io
Interface Formatter

All Known Implementing Classes:
BaseDOMFormatter, HTMLFormatter, XMLFormatter

public interface Formatter

Interface for document-type specific formatters. Instances are single-threaded.


Method Summary
 int getDynamicFormattedElementCount()
          Get the count of element open tags that were written not using preformatted text.
 int getDynamicFormattedTextCount()
          Get the count of text nodes that were written not using preformatted text.
 String getMIMEEncoding()
          Get the MIME-preferred encoding, determined from the OutputOptions and the formatter type.
 int getPreFormattedElementCount()
          Get the count of preformatted element open tags that were written.
 int getPreFormattedTextCount()
          Get the count of preformatted text nodes that were written.
 String preFormatNode(Node node)
          Format the contents of a node that can later be returned by a node implementing FormattedText.
 boolean usedPreFormattedElements()
          Determine if preformatted element open tags were used for the last document formatted.
 boolean usedPreFormattedText()
          Determine if preformatted text was used for the last document formatted.
 void write(Node node, Writer writer)
          Format any Node to the specified writer.
 

Method Detail

getMIMEEncoding

public String getMIMEEncoding()
Get the MIME-preferred encoding, determined from the OutputOptions and the formatter type.

usedPreFormattedText

public boolean usedPreFormattedText()
Determine if preformatted text was used for the last document formatted. The results are only meaninful if called after a call to write().

getPreFormattedTextCount

public int getPreFormattedTextCount()
Get the count of preformatted text nodes that were written.

getDynamicFormattedTextCount

public int getDynamicFormattedTextCount()
Get the count of text nodes that were written not using preformatted text.

usedPreFormattedElements

public boolean usedPreFormattedElements()
Determine if preformatted element open tags were used for the last document formatted. The results are only meaninful if called after a call to write().

getPreFormattedElementCount

public int getPreFormattedElementCount()
Get the count of preformatted element open tags that were written.

getDynamicFormattedElementCount

public int getDynamicFormattedElementCount()
Get the count of element open tags that were written not using preformatted text.

preFormatNode

public String preFormatNode(Node node)
Format the contents of a node that can later be returned by a node implementing FormattedText. Not all node types will return formatted text.

write

public void write(Node node,
                  Writer writer)
           throws IOException
Format any Node to the specified writer.


Copyright © 1999-2002 enhydra.org (Mark Diekhans, David Li, Richard Kunze). All Rights reserved.