org.crosswire.common.xml
Class HTMLSerializingContentHandler
java.lang.Object
org.crosswire.common.xml.PrettySerializingContentHandler
org.crosswire.common.xml.HTMLSerializingContentHandler
- All Implemented Interfaces:
- ContentHandler
public class HTMLSerializingContentHandler
- extends PrettySerializingContentHandler
This class provides for the formatted and syntax highlighted serialization of
a SAX stream to a Writer
.
- Author:
- DM Smith
- See Also:
The GNU Lesser General Public License for details.
Methods inherited from class org.crosswire.common.xml.PrettySerializingContentHandler |
characters, endElement, endPrefixMapping, ignorableWhitespace, processingInstruction, setDocumentLocator, skippedEntity, startElement, startPrefixMapping, toString, write, write |
HTMLSerializingContentHandler
public HTMLSerializingContentHandler()
- A formatting serializer that does not add whitespace to the document.
This uses a StringWriter and the toString method will return its content.
HTMLSerializingContentHandler
public HTMLSerializingContentHandler(FormatType theFormat)
- A formatting serializer that adds whitespace to the document according to
the specified
FormatType
. This uses a StringWriter and the
toString method will return its content.
- Parameters:
theFormat
- the formatting to use
HTMLSerializingContentHandler
public HTMLSerializingContentHandler(FormatType theFormat,
Writer theWriter)
- A formatting serializer that adds whitespace to the document according to
the specified
FormatType
. As the document is serialized it
is written to the provided Writer
.
- Parameters:
theFormat
- the formatting to usetheWriter
- the writer to use
decorateTagName
protected String decorateTagName(String tagName)
- Overrides:
decorateTagName
in class PrettySerializingContentHandler
decorateAttributeName
protected String decorateAttributeName(String attrName)
- Overrides:
decorateAttributeName
in class PrettySerializingContentHandler
decorateAttributeValue
protected String decorateAttributeValue(String attrValue)
- Overrides:
decorateAttributeValue
in class PrettySerializingContentHandler
decorateCharacters
protected String decorateCharacters(String characters)
- Overrides:
decorateCharacters
in class PrettySerializingContentHandler
decorateIndent
protected String decorateIndent(int indentLevel)
- Overrides:
decorateIndent
in class PrettySerializingContentHandler
startDocument
public void startDocument()
- Specified by:
startDocument
in interface ContentHandler
- Overrides:
startDocument
in class PrettySerializingContentHandler
endDocument
public void endDocument()
- Specified by:
endDocument
in interface ContentHandler
- Overrides:
endDocument
in class PrettySerializingContentHandler
getEmptyTagEnd
protected String getEmptyTagEnd()
- Overrides:
getEmptyTagEnd
in class PrettySerializingContentHandler
getEndTagStart
protected String getEndTagStart()
- Overrides:
getEndTagStart
in class PrettySerializingContentHandler
getPIEnd
protected String getPIEnd()
- Overrides:
getPIEnd
in class PrettySerializingContentHandler
getPIStart
protected String getPIStart()
- Overrides:
getPIStart
in class PrettySerializingContentHandler
getTagEnd
protected String getTagEnd()
- Overrides:
getTagEnd
in class PrettySerializingContentHandler
getTagStart
protected String getTagStart()
- Overrides:
getTagStart
in class PrettySerializingContentHandler
getNewline
protected String getNewline()
- Overrides:
getNewline
in class PrettySerializingContentHandler