public class XMLContentHandler extends Object implements ContentHandler
| Constructor and Description |
|---|
XMLContentHandler()
Creates a new XMLBuilder.
|
| Modifier and Type | Method and Description |
|---|---|
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.
|
public void characters(char[] chars,
int start,
int length)
throws SAXException
characters in interface ContentHandlerchars - The character array containing the XML contentstart - First index of character for our new Text nodelength - count of characters for our Text node.SAXException - neverpublic void endDocument()
throws SAXException
endDocument in interface ContentHandlerSAXException - neverpublic void endElement(String uri, String name, String qName) throws SAXException
endElement in interface ContentHandleruri - The namespace URIname - the local name of the element.qName - the qualified naem of the elementSAXException - if we have a mismatched end element tagpublic void endPrefixMapping(String prefix) throws SAXException
endPrefixMapping in interface ContentHandlerprefix - The namespace prefix mapping that is endingSAXException - neverpublic Root getRoot()
public void ignorableWhitespace(char[] chars,
int start,
int length)
throws SAXException
ignorableWhitespace in interface ContentHandlerchars - The character array containing the XML contentstart - First index of the ignorable whitespacelength - count of characters for the ignorable whitespaceSAXException - neverpublic void processingInstruction(String target, String data) throws SAXException
processingInstruction in interface ContentHandlertarget - the target of the processing instructiondata - the content of the processing instructionSAXException - neverpublic void setDocumentLocator(Locator locator)
setDocumentLocator in interface ContentHandlerlocator - the Locator used by this DocumentHandler.public void skippedEntity(String name)
skippedEntity in interface ContentHandlername - the name of the skipped entity.public void startDocument()
throws SAXException
startDocument in interface ContentHandlerSAXException - neverpublic void startElement(String uri, String name, String qName, Attributes atts) throws SAXException
startElement in interface ContentHandleruri - The namespace URIname - the local name of the element.qName - the qualified naem of the elementatts - a list of attributes for this ElementSAXException - If we are not given an element name.public void startPrefixMapping(String prefix, String uri)
startPrefixMapping in interface ContentHandlerprefix - The namespace prefix mapping that is endinguri - The namespace URISAXException - neverCopyright © 2021. All rights reserved.