| Modifier and Type | Field and Description |
|---|---|
| private Document | |
| private DocumentBuilderFactory | _factory
JAXP document builder factory. |
| private boolean | |
| private Node | |
| private List | |
| private Node | |
| private Node | |
| private Stack | |
| private Node | |
| private StringBuilder | |
| private Locator | |
| private boolean |
| Access | Constructor and Description |
|---|---|
| public | |
| public | |
| public |
| Modifier and Type | Method and Description |
|---|---|
| private void | |
| public void | characters(char[] ch, int start, int length)
Implements org. Receive notification of character data. |
| public void | comment(char[] ch, int start, int length)
Implements org. Lexical Handler method to create comment node in DOM tree. |
| private Document | |
| public void | |
| public void | endDocument()
Implements org. Receive notification of the end of a document. |
| public void | |
| public void | endElement(String namespace, String localName, String qName)
Implements org. Receive notification of the end of an element. |
| public void | endEntity(String name)
Implements org. Report the end of an entity. |
| public void | endPrefixMapping(String prefix)
Implements org. End the scope of a prefix-URI mapping. |
| public Node | |
| public void | ignorableWhitespace(char[] ch, int start, int length)
Implements org. This class is only used internally so this method should never be called. |
| public void | processingInstruction(String target, String data)
Implements org. adds processing instruction node to DOM. |
| private void | |
| public void | setDocumentLocator(Locator locator)
Implements org. This class is only used internally so this method should never be called. |
| public void | skippedEntity(String name)
Implements org. This class is only used internally so this method should never be called. |
| public void | startCDATA()
Implements org. Report the start of a CDATA section. |
| public void | startDocument()
Implements org. Receive notification of the beginning of a document. |
| public void | startDTD(String name, String publicId, String systemId)
Implements org. Report the start of DTD declarations, if any. |
| public void | startElement(String namespace, String localName, String qName, Attributes attrs)
Implements org. Receive notification of the beginning of an element. |
| public void | startEntity(String name)
Implements org. Report the beginning of some internal and external XML entities. |
| public void | startPrefixMapping(String prefix, String uri)
Implements org. Begin the scope of a prefix-URI Namespace mapping. |
| _document | back to summary |
|---|---|
| private Document _document | |
| _factory | back to summary |
|---|---|
| private DocumentBuilderFactory _factory JAXP document builder factory. Create a single instance and use synchronization because the Javadoc is not explicit about thread safety. | |
| _internal | back to summary |
|---|---|
| private boolean _internal | |
| _lastSibling | back to summary |
|---|---|
| private Node _lastSibling | |
| _namespaceDecls | back to summary |
|---|---|
| private List<String> _namespaceDecls | |
| _nextSibling | back to summary |
|---|---|
| private Node _nextSibling | |
| _nextSiblingCache | back to summary |
|---|---|
| private Node _nextSiblingCache | |
| _nodeStk | back to summary |
|---|---|
| private Stack<Node> _nodeStk | |
| _root | back to summary |
|---|---|
| private Node _root | |
| _textBuffer | back to summary |
|---|---|
| private StringBuilder _textBuffer | |
| locator | back to summary |
|---|---|
| private Locator locator | |
| needToSetDocumentInfo | back to summary |
|---|---|
| private boolean needToSetDocumentInfo | |
| SAX2DOM | back to summary |
|---|---|
| public SAX2DOM(boolean overrideDefaultParser) throws ParserConfigurationException | |
| SAX2DOM | back to summary |
|---|---|
| public SAX2DOM(Node root, Node nextSibling, boolean overrideDefaultParser) throws ParserConfigurationException | |
| SAX2DOM | back to summary |
|---|---|
| public SAX2DOM(Node root, boolean overrideDefaultParser) throws ParserConfigurationException | |
| appendTextNode | back to summary |
|---|---|
| private void appendTextNode() | |
| characters | back to summary |
|---|---|
| public void characters(char[] ch, int start, int length) Implements org. Doc from org. Receive notification of character data. The Parser will call this method to report each chunk of character data. SAX parsers may return all contiguous character data in a single chunk, or they may split it into several chunks; however, all of the characters in any single event must come from the same external entity so that the Locator provides useful information. The application must not attempt to read from the array outside of the specified range. Individual characters may consist of more than one Java
Your code should not assume that algorithms using
Note that some parsers will report whitespace in element
content using the | |
| comment | back to summary |
|---|---|
| public void comment(char[] ch, int start, int length) Implements org. Lexical Handler method to create comment node in DOM tree. | |
| createDocument | back to summary |
|---|---|
| private Document createDocument(boolean overrideDefaultParser) throws ParserConfigurationException | |
| endCDATA | back to summary |
|---|---|
| public void endCDATA() Implements org. Doc from org. Report the end of a CDATA section. | |
| endDocument | back to summary |
|---|---|
| public void endDocument() Implements org. Doc from org. Receive notification of the end of a document. This method is invoked by the parser to signal it has reached the end of the document after successfully completing the parsing process. After the event, the parser will return the control to the application. | |
| endDTD | back to summary |
|---|---|
| public void endDTD() Implements org. Doc from org. Report the end of DTD declarations. This method is intended to report the end of the DOCTYPE declaration; if the document has no DOCTYPE declaration, this method will not be invoked. | |
| endElement | back to summary |
|---|---|
| public void endElement(String namespace, String localName, String qName) Implements org. Doc from org. Receive notification of the end of an element. The SAX parser will invoke this method at the end of every
element in the XML document; there will be a corresponding
For information on the names, see startElement. | |
| endEntity | back to summary |
|---|---|
| public void endEntity(String name) Implements org. Doc from org. Report the end of an entity. | |
| endPrefixMapping | back to summary |
|---|---|
| public void endPrefixMapping(String prefix) Implements org. Doc from org. End the scope of a prefix-URI mapping. See | |
| getDOM | back to summary |
|---|---|
| public Node getDOM() | |
| ignorableWhitespace | back to summary |
|---|---|
| public void ignorableWhitespace(char[] ch, int start, int length) Implements org. This class is only used internally so this method should never be called. | |
| processingInstruction | back to summary |
|---|---|
| public void processingInstruction(String target, String data) Implements org. adds processing instruction node to DOM. | |
| setDocumentInfo | back to summary |
|---|---|
| private void setDocumentInfo() | |
| setDocumentLocator | back to summary |
|---|---|
| public void setDocumentLocator(Locator locator) Implements org. This class is only used internally so this method should never be called. | |
| skippedEntity | back to summary |
|---|---|
| public void skippedEntity(String name) Implements org. This class is only used internally so this method should never be called. | |
| startCDATA | back to summary |
|---|---|
| public void startCDATA() Implements org. Doc from org. Report the start of a CDATA section. The contents of the CDATA section will be reported through
the regular | |
| startDocument | back to summary |
|---|---|
| public void startDocument() Implements org. Doc from org. Receive notification of the beginning of a document. The SAX parser will invoke this method only once, before any
other event callbacks (except for | |
| startDTD | back to summary |
|---|---|
| public void startDTD(String name, String publicId, String systemId) throws SAXException Implements org. Doc from org. Report the start of DTD declarations, if any. This method is intended to report the beginning of the DOCTYPE declaration; if the document has no DOCTYPE declaration, this method will not be invoked. All declarations reported through
Note that the start/endDTD events will appear within
the start/endDocument events from ContentHandler and
before the first
| |
| startElement | back to summary |
|---|---|
| public void startElement(String namespace, String localName, String qName, Attributes attrs) Implements org. Doc from org. Receive notification of the beginning of an element. The Parser will invoke this method at the beginning of every
element in the XML document; there will be a corresponding
This event allows up to three name components for each element:
Any or all of these may be provided, depending on the values of the http://xml.org/sax/features/namespaces and the http://xml.org/sax/features/namespace-prefixes properties:
Note that the attribute list provided will contain only
attributes with explicit values (specified or defaulted):
#IMPLIED attributes will be omitted. The attribute list
will contain attributes used for Namespace declarations
(xmlns* attributes) only if the
Like | |
| startEntity | back to summary |
|---|---|
| public void startEntity(String name) Implements org. Doc from org. Report the beginning of some internal and external XML entities. The reporting of parameter entities (including
the external DTD subset) is optional, and SAX2 drivers that
report LexicalHandler events may not implement it; you can use the
General entities are reported with their regular names, parameter entities have '%' prepended to their names, and the external DTD subset has the pseudo-entity name "[dtd]". When a SAX2 driver is providing these events, all other
events must be properly nested within start/end entity
events. There is no additional requirement that events from
Note that skipped entities will be reported through the
Because of the streaming event model that SAX uses, some entity boundaries cannot be reported under any circumstances:
These will be silently expanded, with no indication of where the original entity boundaries were. Note also that the boundaries of character references (which are not really entities anyway) are not reported. All start/endEntity events must be properly nested. | |
| startPrefixMapping | back to summary |
|---|---|
| public void startPrefixMapping(String prefix, String uri) Implements org. Doc from org. Begin the scope of a prefix-URI Namespace mapping. The information from this event is not necessary for
normal Namespace processing: the SAX XML reader will
automatically replace prefixes for element and attribute
names when the There are cases, however, when applications need to use prefixes in character data or in attribute values, where they cannot safely be expanded automatically; the start/endPrefixMapping event supplies the information to the application to expand prefixes in those contexts itself, if necessary. Note that start/endPrefixMapping events are not
guaranteed to be properly nested relative to each other:
all startPrefixMapping events will occur immediately before the
corresponding There should never be start/endPrefixMapping events for the "xml" prefix, since it is predeclared and immutable. | |