org.castor.xmlctf.xmldiff.xml

Class XMLContentHandler

Implemented Interfaces:
ContentHandler

public class XMLContentHandler
extends java.lang.Object
implements ContentHandler

A ContentHandler implementation that builds a tree of XMLNodes.
Version:
$Revision: 0000 $ $Date: 2007-01-11 00:00:00 -0600 (Thu, 11 Jan 2007) $
Author:
Edward Kuns
Since:
Castor 1.1

Constructor Summary

XMLContentHandler()
Creates a new XMLBuilder.

Method Summary

void
characters(char[] chars, int start, int length)
Creates a new text node from incoming characters.
void
endDocument()
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.
Root
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
startDocument()
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.

Constructor Details

XMLContentHandler

public XMLContentHandler()
Creates a new XMLBuilder.

Method Details

characters

public void characters(char[] chars,
                       int start,
                       int length)
            throws SAXException
Creates a new text node from incoming characters.
Parameters:
chars - The character array containing the XML content
start - First index of character for our new Text node
length - count of characters for our Text node.

endDocument

public void endDocument()
            throws SAXException
Signals the end of the document.

endElement

public void endElement(String uri,
                       String name,
                       String qName)
            throws SAXException
Signals the end of an Element.
Parameters:
uri - The namespace URI
name - the local name of the element.
qName - the qualified naem of the element

endPrefixMapping

public void endPrefixMapping(String prefix)
            throws SAXException
Signals the end of prefix mapping.
Parameters:
prefix - The namespace prefix mapping that is ending

getRoot

public Root getRoot()
Returns the Root node.
Returns:
the root node.

ignorableWhitespace

public void ignorableWhitespace(char[] chars,
                                int start,
                                int length)
            throws SAXException
Ignores ignorable whitespace.
Parameters:
chars - The character array containing the XML content
start - First index of the ignorable whitespace
length - count of characters for the ignorable whitespace

processingInstruction

public void processingInstruction(String target,
                                  String data)
            throws SAXException
Creates a new Processing Instruction node.
Parameters:
target - the target of the processing instruction
data - the content of the processing instruction

setDocumentLocator

public void setDocumentLocator(Locator locator)
Configures the Locator we will use.
Parameters:
locator - the Locator used by this DocumentHandler.

skippedEntity

public void skippedEntity(String name)
Gives notification about a skipped Entity during XML parsing.
Parameters:
name - the name of the skipped entity.

startDocument

public void startDocument()
            throws SAXException
Signals the beginning of the document.

startElement

public void startElement(String uri,
                         String name,
                         String qName,
                         Attributes atts)
            throws SAXException
Signals the beginning of an Element node.
Parameters:
uri - The namespace URI
name - the local name of the element.
qName - the qualified naem of the element
atts - a list of attributes for this Element

startPrefixMapping

public void startPrefixMapping(String prefix,
                               String uri)
Begins the scope of a prefix-URI Namespace mapping.
Parameters:
prefix - The namespace prefix mapping that is ending
uri - The namespace URI

Intalio Inc. (C) 1999-2008. All rights reserved http://www.intalio.com