Package org.castor.xmlctf.xmldiff.xml
Class XMLContentHandler
java.lang.Object
org.castor.xmlctf.xmldiff.xml.XMLContentHandler
- All Implemented Interfaces:
ContentHandler
A ContentHandler implementation that builds a tree of XMLNodes.
- Since:
- Castor 1.1
- Version:
- $Revision: 0000 $ $Date: 2007-01-11 00:00:00 -0600 (Thu, 11 Jan 2007) $
- Author:
- Edward Kuns
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
characters
(char[] chars, int start, int length) Creates a new text node from incoming characters.void
Signals the end of the document.void
endElement
(String uri, String name, String qName) Signals the end of an Element.void
endPrefixMapping
(String prefix) Signals the end of prefix mapping.getRoot()
Returns the Root node.void
ignorableWhitespace
(char[] chars, int start, int length) Ignores ignorable whitespace.void
processingInstruction
(String target, String data) Creates a new Processing Instruction node.void
setDocumentLocator
(Locator locator) Configures the Locator we will use.void
skippedEntity
(String name) Gives notification about a skipped Entity during XML parsing.void
Signals the beginning of the document.void
startElement
(String uri, String name, String qName, Attributes atts) Signals the beginning of an Element node.void
startPrefixMapping
(String prefix, String uri) Begins the scope of a prefix-URI Namespace mapping.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.xml.sax.ContentHandler
declaration
-
Constructor Details
-
XMLContentHandler
public XMLContentHandler()Creates a new XMLBuilder.
-
-
Method Details
-
characters
Creates a new text node from incoming characters.- Specified by:
characters
in interfaceContentHandler
- Parameters:
chars
- The character array containing the XML contentstart
- First index of character for our new Text nodelength
- count of characters for our Text node.- Throws:
SAXException
- never
-
endDocument
Signals the end of the document.- Specified by:
endDocument
in interfaceContentHandler
- Throws:
SAXException
- never
-
endElement
Signals the end of an Element.- Specified by:
endElement
in interfaceContentHandler
- Parameters:
uri
- The namespace URIname
- the local name of the element.qName
- the qualified naem of the element- Throws:
SAXException
- if we have a mismatched end element tag
-
endPrefixMapping
Signals the end of prefix mapping.- Specified by:
endPrefixMapping
in interfaceContentHandler
- Parameters:
prefix
- The namespace prefix mapping that is ending- Throws:
SAXException
- never
-
getRoot
-
ignorableWhitespace
Ignores ignorable whitespace.- Specified by:
ignorableWhitespace
in interfaceContentHandler
- Parameters:
chars
- The character array containing the XML contentstart
- First index of the ignorable whitespacelength
- count of characters for the ignorable whitespace- Throws:
SAXException
- never
-
processingInstruction
Creates a new Processing Instruction node.- Specified by:
processingInstruction
in interfaceContentHandler
- Parameters:
target
- the target of the processing instructiondata
- the content of the processing instruction- Throws:
SAXException
- never
-
setDocumentLocator
Configures the Locator we will use.- Specified by:
setDocumentLocator
in interfaceContentHandler
- Parameters:
locator
- the Locator used by this DocumentHandler.
-
skippedEntity
Gives notification about a skipped Entity during XML parsing.- Specified by:
skippedEntity
in interfaceContentHandler
- Parameters:
name
- the name of the skipped entity.
-
startDocument
Signals the beginning of the document.- Specified by:
startDocument
in interfaceContentHandler
- Throws:
SAXException
- never
-
startElement
public void startElement(String uri, String name, String qName, Attributes atts) throws SAXException Signals the beginning of an Element node.- Specified by:
startElement
in interfaceContentHandler
- Parameters:
uri
- The namespace URIname
- the local name of the element.qName
- the qualified naem of the elementatts
- a list of attributes for this Element- Throws:
SAXException
- If we are not given an element name.
-
startPrefixMapping
Begins the scope of a prefix-URI Namespace mapping.- Specified by:
startPrefixMapping
in interfaceContentHandler
- Parameters:
prefix
- The namespace prefix mapping that is endinguri
- The namespace URI- Throws:
SAXException
- never
-