| java.lang.Object org.enhydra.xml.io.ExtBaseDOMFormatter
All known Subclasses: org.enhydra.xml.io.ExtXMLFormatter, org.enhydra.xml.io.ExtHTMLFormatter,
ExtBaseDOMFormatter | abstract class ExtBaseDOMFormatter implements Formatter,DOMTraversal.Handler(Code) | | Base class with common functionally XML and HTML DOM formatting
functionality.
|
Constructor Summary | |
protected | ExtBaseDOMFormatter(Node node, OutputOptions outputOptions, boolean forPreFormatting, String defaultEncoding, boolean[] entityQuickCheck) Constructor.
Parameters: node - Any node of the document that this formatter will beassociated with. |
ATTR_QUOTE_CHAR | final protected static char ATTR_QUOTE_CHAR(Code) | | Quote character to use for attribute values.
|
ATTR_QUOTE_CHAR_ENTITY_REF | final protected static String ATTR_QUOTE_CHAR_ENTITY_REF(Code) | | Entity reference for attribute value quote character.
|
MAX_ENTITY_QUICK_CHECK_CHAR | final protected static int MAX_ENTITY_QUICK_CHECK_CHAR(Code) | | Maximum character value in an entity quick-check table.
|
fDocument | final protected Document fDocument(Code) | | Document being formatted.
|
fDynamicFormattedElementCount | protected int fDynamicFormattedElementCount(Code) | | Count of element open tags that were written not using preformatted
text.
|
fOptions | final protected OutputOptions fOptions(Code) | | The output options.
|
fPreFormatMode | final protected boolean fPreFormatMode(Code) | | Are we doing pre-formatting?
|
fPreFormattedElementCount | protected int fPreFormattedElementCount(Code) | | Count of preformatted element open tags that were written.
|
fPrettyPrinting | final protected boolean fPrettyPrinting(Code) | | Are we pretty-printing?
|
fPublicId | final protected String fPublicId(Code) | | Public id to use for DOCTYPE, or null if none.
|
fSystemId | final protected String fSystemId(Code) | | System id to use for DOCTYPE, or null if none.
|
fTraverser | final protected DOMTraversal fTraverser(Code) | | DOM traverser.
|
fUsePreFormattedAttrText | final protected boolean fUsePreFormattedAttrText(Code) | | Should pre-formatted text be use for descendents of attribute
nodes. A seperate flag is required to support the
omitAttributeCharEntityRefs option.
|
fUsePreFormattedElements | final protected boolean fUsePreFormattedElements(Code) | | Should pre-formatted Elements be written. This is the same as
fUsePreFormattedText, unless a URLRewriter is present, in which
case it's false since we need to check the attributes for URLs.
|
fUsePreFormattedText | final protected boolean fUsePreFormattedText(Code) | | Should pre-formatted text be written. This is only enabled if the
document implements PreFormattedTextDocument and the preformatted
encoding matches the output encoding. This option only controls
text nodes that are not children of attributes.
|
ExtBaseDOMFormatter | protected ExtBaseDOMFormatter(Node node, OutputOptions outputOptions, boolean forPreFormatting, String defaultEncoding, boolean[] entityQuickCheck)(Code) | | Constructor.
Parameters: node - Any node of the document that this formatter will beassociated with. This can also be an XMLC Document object (XMLObject). Parameters: options - The output options. Parameters: defaultEncoding - The default encoding for this format. Parameters: forPreFormatting - Is this going to be used for preformatting? Parameters: entityQuickCheck - Document-type specific table that providesa quick check of the need to encode that character as a characterentity reference. This table MUST include the double-quote character,as it it used to quote attribute values. |
findDocumentInfo | public static DocumentInfo findDocumentInfo(Document document)(Code) | | Get the DocumentInfo object, if available.
This is our extension
|
getCharacterEntity | abstract protected String getCharacterEntity(char textChar)(Code) | | Get a character entity name for a character.
This is the slow-path, so its ok this is an abstract method call.
The character entity name, or null if this character doesn'thave one. |
getDynamicFormattedElementCount | final public int getDynamicFormattedElementCount()(Code) | | Get the count of element open tags that were written not using
preformatted text.
|
getDynamicFormattedTextCount | final public int getDynamicFormattedTextCount()(Code) | | Get the count of text nodes that were written not using
preformatted text.
|
getMIMEEncoding | final public String getMIMEEncoding()(Code) | | See Also: Formatter.getMIMEEncoding |
getPreFormattedElementCount | final public int getPreFormattedElementCount()(Code) | | Get the count of preformatted element open tags that were written.
|
getPreFormattedTextCount | final public int getPreFormattedTextCount()(Code) | | Get the count of preformatted text nodes that were written.
|
handleComment | final public void handleComment(Comment comment) throws IOException(Code) | | Handler called for Comment nodes.
See Also: org.enhydra.xml.dom.DOMTraversal.Handler.handleComment |
handleEntity | final public void handleEntity(Entity entity)(Code) | | Handler called for Entity nodes; should never be called.
See Also: org.enhydra.xml.dom.DOMTraversal.Handler.handleEntity |
handleEntityReference | final public void handleEntityReference(EntityReference entityRef) throws IOException(Code) | | Handler called for EntityReference nodes.
See Also: org.enhydra.xml.dom.DOMTraversal.Handler.handleEntityReference |
handleNotation | final public void handleNotation(Notation notation)(Code) | | Handler called for Notation nodes; should never be called.
See Also: org.enhydra.xml.dom.DOMTraversal.Handler.handleNotation |
handleText | public void handleText(Text text) throws IOException(Code) | | Handler called for Text nodes.
See Also: org.enhydra.xml.dom.DOMTraversal.Handler.handleText |
preFormatNode | final public String preFormatNode(Node node)(Code) | | See Also: Formatter.preFormatNode |
printIndent | final protected void printIndent() throws IOException(Code) | | Print indentation to the current level.
|
usedPreFormattedElements | final public boolean usedPreFormattedElements()(Code) | | See Also: Formatter.usedPreFormattedElements |
usedPreFormattedText | public boolean usedPreFormattedText()(Code) | | See Also: Formatter.usedPreFormattedText |
write | final public void write(Node node, Writer writer) throws IOException(Code) | | Format a Node and children to the specified writer.
See Also: Formatter.write |
writeAttributeValue | final protected void writeAttributeValue(Attr attr) throws IOException(Code) | | Write an attribute value. Convert characters to character entity
references as needed.
|
writeOpenTag | abstract protected void writeOpenTag(Element element, String tagName, boolean hasChildren) throws IOException(Code) | | Method to write an open tag, including attributes. Children
are not processed. This is normally called by the derived class
handleElement method, but its hear to allow for use by preformatter.
|
writeText | final protected void writeText(String text) throws IOException(Code) | | Write a text string, encoding document type-specific character entities.
This is an expensive procedure and has been carefully hand optimized.
|
|
|