org.crosswire.common.xml
Class HTMLSerializingContentHandler

java.lang.Object
  extended by org.crosswire.common.xml.PrettySerializingContentHandler
      extended by 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 [ dmsmith555 at gmail dot com]
See Also:
for license details.
The copyright to this program is held by it's authors.

Constructor Summary
HTMLSerializingContentHandler()
          A formatting serializer that does not add whitespace to the document.
HTMLSerializingContentHandler(FormatType theFormat)
          A formatting serializer that adds whitespace to the document according to the specified FormatType.
HTMLSerializingContentHandler(FormatType theFormat, Writer theWriter)
          A formatting serializer that adds whitespace to the document according to the specified FormatType.
 
Method Summary
protected  String decorateAttributeName(String attrName)
           
protected  String decorateAttributeValue(String attrValue)
           
protected  String decorateCharacters(String characters)
           
protected  String decorateIndent(int indentLevel)
           
protected  String decorateTagName(String tagName)
           
 void endDocument()
           
protected  String getEmptyTagEnd()
           
protected  String getEndTagStart()
           
protected  String getNewline()
           
protected  String getPIEnd()
           
protected  String getPIStart()
           
protected  String getTagEnd()
           
protected  String getTagStart()
           
 void startDocument()
           
 
Methods inherited from class org.crosswire.common.xml.PrettySerializingContentHandler
characters, endElement, endPrefixMapping, ignorableWhitespace, processingInstruction, setDocumentLocator, skippedEntity, startElement, startPrefixMapping, toString, write, write
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

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 use
theWriter - the writer to use
Method Detail

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

Copyright ? 2003-2006