org.apache.commons.digester
Class NodeCreateRule.NodeBuilder
DefaultHandler
org.apache.commons.digester.NodeCreateRule.NodeBuilder
- NodeCreateRule
private class NodeCreateRule.NodeBuilder
extends DefaultHandler
The SAX content handler that does all the actual work of assembling the
DOM node tree from the SAX events.
protected int | depth - Depth of the current node, relative to the element where the content
handler was put into action.
|
protected Document | doc - A DOM Document used to create the various Node instances.
|
protected ContentHandler | oldContentHandler - The content handler used by Digester before it was set to this
content handler.
|
protected Node | root - The DOM node that will be pushed on Digester's stack.
|
protected Node | top - The current top DOM mode.
|
void | characters(char[] ch, int start, int length) - Appends a
Text node to the current node.
|
void | endElement(String namespaceURI, String localName, String qName) - Checks whether control needs to be returned to Digester.
|
void | processingInstruction(String target, String data) - Adds a new
ProcessingInstruction to
the current node.
|
void | startElement(String namespaceURI, String localName, String qName, Attributes atts) - Adds a new child
Element to the current
node.
|
depth
protected int depth
Depth of the current node, relative to the element where the content
handler was put into action.
doc
protected Document doc
A DOM Document used to create the various Node instances.
oldContentHandler
protected ContentHandler oldContentHandler
The content handler used by Digester before it was set to this
content handler.
root
protected Node root
The DOM node that will be pushed on Digester's stack.
top
protected Node top
The current top DOM mode.
NodeBuilder
public NodeBuilder(Document doc,
Node root)
throws ParserConfigurationException,
SAXException
Constructor.
Stores the content handler currently used by Digester so it can
be reset when done, and initializes the DOM objects needed to
build the node.
doc
- the document to use to create nodesroot
- the root node
characters
public void characters(char[] ch,
int start,
int length)
throws SAXException
Appends a Text
node to the current node.
ch
- the characters from the XML documentstart
- the start position in the arraylength
- the number of characters to read from the array
endElement
public void endElement(String namespaceURI,
String localName,
String qName)
throws SAXException
Checks whether control needs to be returned to Digester.
namespaceURI
- the namespace URIlocalName
- the local nameqName
- the qualified (prefixed) name
processingInstruction
public void processingInstruction(String target,
String data)
throws SAXException
Adds a new
ProcessingInstruction
to
the current node.
target
- the processing instruction targetdata
- the processing instruction data, or null if none was
supplied
startElement
public void startElement(String namespaceURI,
String localName,
String qName,
Attributes atts)
throws SAXException
Adds a new child Element
to the current
node.
namespaceURI
- the namespace URIlocalName
- the local nameqName
- the qualified (prefixed) nameatts
- the list of attributes
Copyright (c) 2001-2004 - Apache Software Foundation