Enhydra 3.1b2 API

org.enhydra.xml.io
Interface Formatter


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.
 java.lang.String getJavaEncoding()
          Get the Java 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.
 java.lang.String getXmlEncoding()
          Get the XML encoding, determined from the OutputOptions and the formatter type.
 java.lang.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, java.io.Writer writer)
          Format any Node to the specified writer.
 

Method Detail

getJavaEncoding

public java.lang.String getJavaEncoding()
Get the Java encoding, determined from the OutputOptions and the formatter type.

getXmlEncoding

public java.lang.String getXmlEncoding()
Get the XML 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 java.lang.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,
                  java.io.Writer writer)
           throws java.io.IOException
Format any Node to the specified writer.

Enhydra 3.1b2 API