LexicalHandler, DeclHandler, and
EntityResolver2 extensions. Except for overriding the
original SAX1 resolveEntity()
method the added handler methods just return. Subclassers may
override everything on a method-by-method basis.Note
this class might yet learn that the
ContentHandler.setDocumentLocator() call might be passed a
Locator2 object, and that the
ContentHandler.startElement() call might be passed a
Attributes2 object.
| Access | Constructor and Description |
|---|---|
| public |
| Modifier and Type | Method and Description |
|---|---|
| public void | attributeDecl(String eName, String aName, String type, String mode, String value)
Implements org. Report an attribute type declaration. |
| public void | comment(char[] ch, int start, int length)
Implements org. Report an XML comment anywhere in the document. |
| public void | elementDecl(String name, String model)
Implements org. Report an element type declaration. |
| public void | |
| public void | |
| public void | endEntity(String name)
Implements org. Report the end of an entity. |
| public void | externalEntityDecl(String name, String publicId, String systemId)
Implements org. Report a parsed external entity declaration. |
| public InputSource | getExternalSubset(String name, String baseURI)
Implements org. Tells the parser that if no external subset has been declared in the document text, none should be used. |
| public void | internalEntityDecl(String name, String value)
Implements org. Report an internal entity declaration. |
| public InputSource | resolveEntity(String name, String publicId, String baseURI, String systemId)
Implements org. Tells the parser to resolve the systemId against the baseURI and read the entity text from that resulting absolute URI. |
| public InputSource | resolveEntity(String publicId, String systemId)
Overrides org. Implements org. Invokes
|
| public void | startCDATA()
Implements org. Report the start of a CDATA section. |
| public void | startDTD(String name, String publicId, String systemId)
Implements org. Report the start of DTD declarations, if any. |
| public void | startEntity(String name)
Implements org. Report the beginning of some internal and external XML entities. |
| DefaultHandler2 | back to summary |
|---|---|
| public DefaultHandler2() Constructs a handler which ignores all parsing events. | |
| attributeDecl | back to summary |
|---|---|
| public void attributeDecl(String eName, String aName, String type, String mode, String value) throws SAXException Implements org. Doc from org. Report an attribute type declaration. Only the effective (first) declaration for an attribute will be reported. The type will be one of the strings "CDATA", "ID", "IDREF", "IDREFS", "NMTOKEN", "NMTOKENS", "ENTITY", "ENTITIES", a parenthesized token group with the separator "|" and all whitespace removed, or the word "NOTATION" followed by a space followed by a parenthesized token group with all whitespace removed. The value will be the value as reported to applications, appropriately normalized and with entity and character references expanded.
| |
| comment | back to summary |
|---|---|
| public void comment(char[] ch, int start, int length) throws SAXException Implements org. Doc from org. Report an XML comment anywhere in the document. This callback will be used for comments inside or outside the document element, including comments in the external DTD subset (if read). Comments in the DTD must be properly nested inside start/endDTD and start/endEntity events (if used).
| |
| elementDecl | back to summary |
|---|---|
| public void elementDecl(String name, String model) throws SAXException Implements org. Doc from org. Report an element type declaration. The content model will consist of the string "EMPTY", the string "ANY", or a parenthesised group, optionally followed by an occurrence indicator. The model will be normalized so that all parameter entities are fully resolved and all whitespace is removed, and will include the enclosing parentheses. Other normalization (such as removing redundant parentheses or simplifying occurrence indicators) is at the discretion of the parser.
| |
| endCDATA | back to summary |
|---|---|
| public void endCDATA() throws SAXException Implements org. Doc from org. Report the end of a CDATA section.
| |
| endDTD | back to summary |
|---|---|
| public void endDTD() throws SAXException 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.
| |
| endEntity | back to summary |
|---|---|
| public void endEntity(String name) throws SAXException Implements org. Doc from org. Report the end of an entity.
| |
| externalEntityDecl | back to summary |
|---|---|
| public void externalEntityDecl(String name, String publicId, String systemId) throws SAXException Implements org. Doc from org. Report a parsed external entity declaration. Only the effective (first) declaration for each entity will be reported. If the system identifier is a URL, the parser must resolve it fully before passing it to the application.
| |
| getExternalSubset | back to summary |
|---|---|
| public InputSource getExternalSubset(String name, String baseURI) throws SAXException, IOException Implements org. Tells the parser that if no external subset has been declared in the document text, none should be used.
| |
| internalEntityDecl | back to summary |
|---|---|
| public void internalEntityDecl(String name, String value) throws SAXException Implements org. Doc from org. Report an internal entity declaration. Only the effective (first) declaration for each entity will be reported. All parameter entities in the value will be expanded, but general entities will not.
| |
| resolveEntity | back to summary |
|---|---|
| public InputSource resolveEntity(String name, String publicId, String baseURI, String systemId) throws SAXException, IOException Implements org. Tells the parser to resolve the systemId against the baseURI
and read the entity text from that resulting absolute URI.
Note that because the older
| |
| resolveEntity | back to summary |
|---|---|
| public InputSource resolveEntity(String publicId, String systemId) throws SAXException, IOException Overrides org. Implements org. Invokes
| |
| startCDATA | back to summary |
|---|---|
| public void startCDATA() throws SAXException Implements org. Doc from org. Report the start of a CDATA section. The contents of the CDATA section will be reported through
the regular
| |
| 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
| |
| startEntity | back to summary |
|---|---|
| public void startEntity(String name) throws SAXException 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.
| |