Prev Class | Next Class | Frames | No Frames |
Summary: Nested | Field | Method | Constr | Detail: Nested | Field | Method | Constr |
java.lang.Object
gnu.xml.pipeline.DomConsumer.Handler
public static class DomConsumer.Handler
extends java.lang.Object
implements ContentHandler2, LexicalHandler, DTDHandler, DeclHandler
Field Summary | |
protected DomConsumer |
Constructor Summary | |
|
Method Summary | |
void |
|
boolean |
|
void |
|
void |
|
protected Text |
|
void |
|
void |
|
void |
|
void | |
void |
|
void |
|
void |
|
void |
|
protected Document |
|
protected Node |
|
void |
|
void |
|
void |
|
void |
|
void |
|
void |
|
void | |
void |
|
void | |
void |
|
void |
|
void |
|
void |
|
void |
|
protected Handler(DomConsumer consumer) throws SAXException
Subclasses may use SAX2 events to provide additional behaviors in the resulting DOM.
public void attributeDecl(String eName, String aName, String type, String mode, String value) throws SAXException
- Specified by:
- attributeDecl in interface DeclHandler
public boolean canPopulateEntityRefs()
May be overridden by subclasses to return true, indicating that entity reference nodes can be populated and then made read-only.
public void characters(ch[] , int start, int length) throws SAXException
- Specified by:
- characters in interface ContentHandler
public void comment(ch[] , int start, int length) throws SAXException
- Specified by:
- comment in interface LexicalHandler
protected Text createText(boolean isCDATA, ch[] , int start, int length)
Subclasses may overrride this method to provide a more efficient way to construct text nodes. Typically, copying the text into a single character array will be more efficient than doing that as well as allocating other needed for a String, including an internal StringBuffer. Those additional memory and CPU costs can be incurred later, if ever needed. Unfortunately the standard DOM factory APIs encourage those costs to be incurred early.
public void elementDecl(String name, String model) throws SAXException
- Specified by:
- elementDecl in interface DeclHandler
public void endDocument() throws SAXException
- Specified by:
- endDocument in interface ContentHandler
public void endElement(String uri, String localName, String qName) throws SAXException
- Specified by:
- endElement in interface ContentHandler
public void endEntity(String name) throws SAXException
- Specified by:
- endEntity in interface LexicalHandler
public void endPrefixMapping(String prefix) throws SAXException
- Specified by:
- endPrefixMapping in interface ContentHandler
public void externalEntityDecl(String name, String publicId, String SystemId) throws SAXException
- Specified by:
- externalEntityDecl in interface DeclHandler
protected Node getTop()
Returns the current node being populated. This is usually an Element or Document, but it might be an EntityReference node if some implementation-specific code knows how to put those into the result tree and later mark them as readonly.
public void ignorableWhitespace(ch[] , int start, int length) throws SAXException
- Specified by:
- ignorableWhitespace in interface ContentHandler
public void internalEntityDecl(String name, String value) throws SAXException
- Specified by:
- internalEntityDecl in interface DeclHandler
public void notationDecl(String name, String publicId, String SystemId) throws SAXException
- Specified by:
- notationDecl in interface DTDHandler
public void processingInstruction(String target, String data) throws SAXException
- Specified by:
- processingInstruction in interface ContentHandler
public void setDocumentLocator(Locator locator)
- Specified by:
- setDocumentLocator in interface ContentHandler
public void skippedEntity(String name) throws SAXException
- Specified by:
- skippedEntity in interface ContentHandler
public void startCDATA() throws SAXException
- Specified by:
- startCDATA in interface LexicalHandler
public void startDTD(String name, String publicId, String SystemId) throws SAXException
- Specified by:
- startDTD in interface LexicalHandler
public void startDocument() throws SAXException
- Specified by:
- startDocument in interface ContentHandler
public void startElement(String uri, String localName, String qName, Attributes atts) throws SAXException
- Specified by:
- startElement in interface ContentHandler
public void startEntity(String name) throws SAXException
- Specified by:
- startEntity in interface LexicalHandler
public void startPrefixMapping(String prefix, String uri) throws SAXException
- Specified by:
- startPrefixMapping in interface ContentHandler
public void unparsedEntityDecl(String name, String publicId, String SystemId, String notationName) throws SAXException
- Specified by:
- unparsedEntityDecl in interface DTDHandler
public void xmlDecl(String version, String encoding, boolean standalone, String inputEncoding) throws SAXException
Reports the XML declaration.
- Specified by:
- xmlDecl in interface ContentHandler2
- Parameters:
version
- the value of the version attribute in the XML declarationencoding
- the encoding specified in the XML declaration, if anystandalone
- the standalone attribute from the XML declarationinputEncoding
- the encoding of the XML input