public class ProxyContentHandler extends DefaultHandler
As a convenience this class inherits the DefaultHandler class
instead of just the ContentHandler interface. This makes it
possible to use this class as an adapter when using methods like
SAXParser.parse(String, DefaultHandler) that
expect a DefaultHandler instance instead of a ContentHandler.
| Modifier and Type | Field and Description |
|---|---|
protected ContentHandler |
handler
The proxied content handler.
|
| Constructor and Description |
|---|
ProxyContentHandler(ContentHandler handler)
Creates a proxy for the given content handler.
|
| Modifier and Type | Method and Description |
|---|---|
void |
characters(char[] ch,
int start,
int length)
Delegated to
handler. |
void |
endDocument()
Delegated to
handler. |
void |
endElement(String namespaceURI,
String localName,
String qName)
Delegated to
handler. |
void |
endPrefixMapping(String prefix)
Delegated to
handler. |
void |
ignorableWhitespace(char[] ch,
int start,
int length)
Delegated to
handler. |
void |
processingInstruction(String target,
String data)
Delegated to
handler. |
void |
setDocumentLocator(Locator locator)
Delegated to
handler. |
void |
skippedEntity(String name)
Delegated to
handler. |
void |
startDocument()
Delegated to
handler. |
void |
startElement(String namespaceURI,
String localName,
String qName,
Attributes atts)
Delegated to
handler. |
void |
startPrefixMapping(String prefix,
String uri)
Delegated to
handler. |
String |
toString() |
error, fatalError, notationDecl, resolveEntity, unparsedEntityDecl, warningprotected ContentHandler handler
public ProxyContentHandler(ContentHandler handler)
handler - content handler to be proxiedpublic void characters(char[] ch,
int start,
int length)
throws SAXException
handler.characters in interface ContentHandlercharacters in class DefaultHandlerch - passed throughstart - passed throughlength - passed throughSAXException - if an error occurspublic void endDocument()
throws SAXException
handler.endDocument in interface ContentHandlerendDocument in class DefaultHandlerSAXException - if an error occurspublic void endElement(String namespaceURI, String localName, String qName) throws SAXException
handler.endElement in interface ContentHandlerendElement in class DefaultHandlernamespaceURI - passed throughlocalName - passed throughqName - passed throughSAXException - if an error occurspublic void endPrefixMapping(String prefix) throws SAXException
handler.endPrefixMapping in interface ContentHandlerendPrefixMapping in class DefaultHandlerprefix - passed throughSAXException - if an error occurspublic void ignorableWhitespace(char[] ch,
int start,
int length)
throws SAXException
handler.ignorableWhitespace in interface ContentHandlerignorableWhitespace in class DefaultHandlerch - passed throughstart - passed throughlength - passed throughSAXException - if an error occurspublic void processingInstruction(String target, String data) throws SAXException
handler.processingInstruction in interface ContentHandlerprocessingInstruction in class DefaultHandlertarget - passed throughdata - passed throughSAXException - if an error occurspublic void setDocumentLocator(Locator locator)
handler.setDocumentLocator in interface ContentHandlersetDocumentLocator in class DefaultHandlerlocator - passed throughpublic void skippedEntity(String name) throws SAXException
handler.skippedEntity in interface ContentHandlerskippedEntity in class DefaultHandlername - passed throughSAXException - if an error occurspublic void startDocument()
throws SAXException
handler.startDocument in interface ContentHandlerstartDocument in class DefaultHandlerSAXException - if an error occurspublic void startElement(String namespaceURI, String localName, String qName, Attributes atts) throws SAXException
handler.startElement in interface ContentHandlerstartElement in class DefaultHandlernamespaceURI - passed throughlocalName - passed throughqName - passed throughatts - passed throughSAXException - if an error occurspublic void startPrefixMapping(String prefix, String uri) throws SAXException
handler.startPrefixMapping in interface ContentHandlerstartPrefixMapping in class DefaultHandlerprefix - passed throughuri - passed throughSAXException - if an error occursCopyright © 2004–2021 The Apache Software Foundation. All rights reserved.