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 Hashtablenamespaces
protected StringBuffernewContent
protected XMLResourceresource
Constructor Summary
SetContentHandler(XMLResource resource)
Method Summary
voidcharacters(char[] ch, int start, int length)
Receive notification of character data inside an element.
voidendDocument()
Receive notification of the end of the document.
voidendElement(String uri, String localName, String qName)
Receive notification of the end of an element.
voidendPrefixMapping(String prefix)
Receive notification of the end of a Namespace mapping.
voidignorableWhitespace(char[] ch, int start, int length)
Receive notification of ignorable whitespace in element content.
voidprocessingInstruction(String target, String data)
Receive notification of a processing instruction.
voidskippedEntity(String name)
Receive notification of a skipped entity.
voidstartDocument()
Receive notification of the beginning of the document.
voidstartElement(String uri, String localName, String qName, Attributes attributes)
Receive notification of the start of an element.
voidstartPrefixMapping(String prefix, String uri)
Receive notification of the start of a Namespace mapping.

Field Detail

namespaces

protected Hashtable namespaces

newContent

protected StringBuffer newContent

resource

protected XMLResource resource

Constructor Detail

SetContentHandler

public SetContentHandler(XMLResource resource)

Method Detail

characters

public void characters(char[] ch, int start, int length)
Receive notification of character data inside an element.

Parameters: ch The characters. start The start position in the character array. length The number of characters to use from the character array.

Throws: SAXException Description of Exception

See Also: org.xml.sax.ContentHandler#characters

endDocument

public void endDocument()
Receive notification of the end of the document.

Throws: SAXException Description of Exception

See Also: org.xml.sax.ContentHandler#endDocument

endElement

public void endElement(String uri, String localName, String qName)
Receive notification of the end of an element.

Parameters: uri Description of Parameter localName Description of Parameter qName Description of Parameter

Throws: SAXException Description of Exception

See Also: org.xml.sax.ContentHandler#endElement

endPrefixMapping

public void endPrefixMapping(String prefix)
Receive notification of the end of a Namespace mapping.

Parameters: prefix The Namespace prefix being declared.

Throws: SAXException Description of Exception

See Also: org.xml.sax.ContentHandler#endPrefixMapping

ignorableWhitespace

public void ignorableWhitespace(char[] ch, int start, int length)
Receive notification of ignorable whitespace in element content.

Parameters: ch The whitespace characters. start The start position in the character array. length The number of characters to use from the character array.

Throws: SAXException Description of Exception

See Also: org.xml.sax.ContentHandler#ignorableWhitespace

processingInstruction

public void processingInstruction(String target, String data)
Receive notification of a processing instruction.

Parameters: target The processing instruction target. data The processing instruction data, or null if none is supplied.

Throws: SAXException Description of Exception

See Also: org.xml.sax.ContentHandler#processingInstruction

skippedEntity

public void skippedEntity(String name)
Receive notification of a skipped entity.

Parameters: name The name of the skipped entity.

Throws: SAXException Description of Exception

See Also: org.xml.sax.ContentHandler#processingInstruction

startDocument

public void startDocument()
Receive notification of the beginning of the document.

Throws: SAXException Description of Exception

See Also: org.xml.sax.ContentHandler#startDocument

startElement

public void startElement(String uri, String localName, String qName, Attributes attributes)
Receive notification of the start of an element.

Parameters: attributes The specified or defaulted attributes. uri Description of Parameter localName Description of Parameter qName Description of Parameter

Throws: SAXException Description of Exception

See Also: org.xml.sax.ContentHandler#startElement

startPrefixMapping

public void startPrefixMapping(String prefix, String uri)
Receive notification of the start of a Namespace mapping.

Parameters: prefix The Namespace prefix being declared. uri The Namespace URI mapped to the prefix.

Throws: SAXException Description of Exception

See Also: org.xml.sax.ContentHandler#startPrefixMapping