org.xmldb.api.sdk.modules

Class SetContentHandler


public class SetContentHandler
extends DefaultHandler

Simple ContentHandler that just converts the SAX event stream into a text representation of the document and stores it in the associated resource.

Field Summary

protected Hashtable
namespaces
protected StringBuffer
newContent
protected XMLResource
resource

Constructor Summary

SetContentHandler(XMLResource resource)

Method Summary

void
characters(ch[] , int start, int length)
Receive notification of character data inside an element.
void
endDocument()
Receive notification of the end of the document.
void
endElement(String uri, String localName, String qName)
Receive notification of the end of an element.
void
endPrefixMapping(String prefix)
Receive notification of the end of a Namespace mapping.
void
ignorableWhitespace(ch[] , int start, int length)
Receive notification of ignorable whitespace in element content.
void
processingInstruction(String target, String data)
Receive notification of a processing instruction.
void
skippedEntity(String name)
Receive notification of a skipped entity.
void
startDocument()
Receive notification of the beginning of the document.
void
startElement(String uri, String localName, String qName, Attributes attributes)
Receive notification of the start of an element.
void
startPrefixMapping(String prefix, String uri)
Receive notification of the start of a Namespace mapping.

Field Details

namespaces

protected Hashtable namespaces

newContent

protected StringBuffer newContent

resource

protected XMLResource resource

Constructor Details

SetContentHandler

public SetContentHandler(XMLResource resource)

Method Details

characters

public void characters(ch[] ,
                       int start,
                       int length)
            throws SAXException
Receive notification of character data inside an element.
Parameters:
start - The start position in the character array.
length - The number of characters to use from the character array.
See Also:
org.xml.sax.ContentHandler.characters

endDocument

public void endDocument()
            throws SAXException
Receive notification of the end of the document.
See Also:
org.xml.sax.ContentHandler.endDocument

endElement

public void endElement(String uri,
                       String localName,
                       String qName)
            throws SAXException
Receive notification of the end of an element.
Parameters:
uri - Description of Parameter
localName - Description of Parameter
qName - Description of Parameter
See Also:
org.xml.sax.ContentHandler.endElement

endPrefixMapping

public void endPrefixMapping(String prefix)
            throws SAXException
Receive notification of the end of a Namespace mapping.
Parameters:
prefix - The Namespace prefix being declared.
See Also:
org.xml.sax.ContentHandler.endPrefixMapping

ignorableWhitespace

public void ignorableWhitespace(ch[] ,
                                int start,
                                int length)
            throws SAXException
Receive notification of ignorable whitespace in element content.
Parameters:
start - The start position in the character array.
length - The number of characters to use from the character array.
See Also:
org.xml.sax.ContentHandler.ignorableWhitespace

processingInstruction

public void processingInstruction(String target,
                                  String data)
            throws SAXException
Receive notification of a processing instruction.
Parameters:
target - The processing instruction target.
data - The processing instruction data, or null if none is supplied.
See Also:
org.xml.sax.ContentHandler.processingInstruction

skippedEntity

public void skippedEntity(String name)
            throws SAXException
Receive notification of a skipped entity.
Parameters:
name - The name of the skipped entity.
See Also:
org.xml.sax.ContentHandler.processingInstruction

startDocument

public void startDocument()
            throws SAXException
Receive notification of the beginning of the document.
See Also:
org.xml.sax.ContentHandler.startDocument

startElement

public void startElement(String uri,
                         String localName,
                         String qName,
                         Attributes attributes)
            throws SAXException
Receive notification of the start of an element.
Parameters:
uri - Description of Parameter
localName - Description of Parameter
qName - Description of Parameter
attributes - The specified or defaulted attributes.
See Also:
org.xml.sax.ContentHandler.startElement

startPrefixMapping

public void startPrefixMapping(String prefix,
                               String uri)
            throws SAXException
Receive notification of the start of a Namespace mapping.
Parameters:
prefix - The Namespace prefix being declared.
uri - The Namespace URI mapped to the prefix.
See Also:
org.xml.sax.ContentHandler.startPrefixMapping