| java.lang.Object | ||
| ↳ | org.xml.sax.helpers.DefaultHandler | |
| ↳ | com.google.gdata.util.XmlParser | |
Known Direct Subclasses
|
XML parser.
This is a thin layer on top of a SAX parser. The key concept necessary to understand this parser is Element Handler. Element handlers are type-specific parsers. Each handler instance contains an instance of the Java type corresponding to the XML type it parses. At any given time, one handler is active, and zero or more handlers are kept on the stack. This corresponds directly to the set of currently opened XML tags.
To use this parser, one must define an XmlParser.ElementHandler type (usually one per XML schema type),
specify the root element handler, and pass a reader to the
parse(Reader, com.google.gdata.util.XmlParser.ElementHandler, String, String) method.
| Nested Classes | |||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|
| XmlParser.ElementHandler | Base class for custom element handlers. | ||||||||||
| Fields | |||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|
| curHandler | Top of the element handler stack. | ||||||||||
| elementNamespaces | Namespace declarations for the current element. | ||||||||||
| locator | Document locator used to get line and column numbers for SAX events. | ||||||||||
| logger | |||||||||||
| namespaceMap | Set of all namespace declarations valid at the current location. | ||||||||||
| parserFactory | |||||||||||
| rootElementName | Root element name. | ||||||||||
| rootHandler | Root element handler. | ||||||||||
| rootNamespace | Root element namespace URI. | ||||||||||
| unrecognizedElements | Number of unrecognized elements on the stack. | ||||||||||
| Public Constructors | |||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|
| Public Methods | |||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|
SAX callback.
| |||||||||||
SAX callback.
| |||||||||||
SAX callback.
| |||||||||||
SAX callback.
| |||||||||||
Parses XML.
| |||||||||||
Parses XML from a content source provided to the parser at
construction time.
| |||||||||||
Parses XML.
| |||||||||||
SAX callback.
| |||||||||||
SAX callback.
| |||||||||||
SAX callback.
| |||||||||||
| Protected Methods | |||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|
Parses XML.
| |||||||||||
Throws a parse exception with line/column information.
| |||||||||||
|
[Expand]
Inherited Methods | |||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|
From class
org.xml.sax.helpers.DefaultHandler
| |||||||||||
From class
java.lang.Object
| |||||||||||
From interface
org.xml.sax.ContentHandler
| |||||||||||
From interface
org.xml.sax.DTDHandler
| |||||||||||
From interface
org.xml.sax.EntityResolver
| |||||||||||
From interface
org.xml.sax.ErrorHandler
| |||||||||||
Namespace declarations for the current element.
Valid during startElement(String, String, String, Attributes).
Document locator used to get line and column numbers for SAX events.
Set of all namespace declarations valid at the current location. Includes namespace declarations from all ancestor elements.
Root element name.
Root element namespace URI.
Number of unrecognized elements on the stack.
SAX callback.
| text | |
|---|---|
| start | |
| len |
| SAXException |
|---|
SAX callback.
| namespace | |
|---|---|
| localName | |
| qName |
| SAXException |
|---|
SAX callback.
| alias |
|---|
SAX callback.
| text | |
|---|---|
| start | |
| len |
| SAXException |
|---|
Parses XML.
| input | Supplies the XML to parse. |
|---|---|
| rootHandler | The root element handler corresponding to the expected document type. |
| rootNamespace | Root element namespace URI. |
| rootElementName | Root element name. |
| IOException | Thrown by input. |
|---|---|
| ParseException | XML failed to validate against the schema implemented by
rootHandler.
|
Parses XML from a content source provided to the parser at construction time.
| rootHandler | The root element handler corresponding to the expected document type. |
|---|---|
| rootNamespace | Root element namespace URI. |
| rootElementName | Root element name. |
| IOException | Thrown by reader. |
|---|---|
| ParseException | XML failed to validate against the schema implemented by
rootHandler.
|
Parses XML.
| reader | Supplies the XML to parse. |
|---|---|
| rootHandler | The root element handler corresponding to the expected document type. |
| rootNamespace | Root element namespace URI. |
| rootElementName | Root element name. |
| IOException | Thrown by reader. |
|---|---|
| ParseException | XML failed to validate against the schema implemented by
rootHandler.
|
SAX callback.
| locator |
|---|
SAX callback.
| namespace | |
|---|---|
| localName | |
| qName | |
| attrs |
| SAXException |
|---|
SAX callback.
| alias | |
|---|---|
| uri |
Parses XML.
| is | Supplies the XML to parse. |
|---|
| IOException | Thrown by is. |
|---|---|
| ParseException | XML failed to validate against the schema implemented by
rootHandler.
|