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, warning
protected 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 ContentHandler
characters
in class DefaultHandler
ch
- passed throughstart
- passed throughlength
- passed throughSAXException
- if an error occurspublic void endDocument() throws SAXException
handler
.endDocument
in interface ContentHandler
endDocument
in class DefaultHandler
SAXException
- if an error occurspublic void endElement(String namespaceURI, String localName, String qName) throws SAXException
handler
.endElement
in interface ContentHandler
endElement
in class DefaultHandler
namespaceURI
- passed throughlocalName
- passed throughqName
- passed throughSAXException
- if an error occurspublic void endPrefixMapping(String prefix) throws SAXException
handler
.endPrefixMapping
in interface ContentHandler
endPrefixMapping
in class DefaultHandler
prefix
- passed throughSAXException
- if an error occurspublic void ignorableWhitespace(char[] ch, int start, int length) throws SAXException
handler
.ignorableWhitespace
in interface ContentHandler
ignorableWhitespace
in class DefaultHandler
ch
- passed throughstart
- passed throughlength
- passed throughSAXException
- if an error occurspublic void processingInstruction(String target, String data) throws SAXException
handler
.processingInstruction
in interface ContentHandler
processingInstruction
in class DefaultHandler
target
- passed throughdata
- passed throughSAXException
- if an error occurspublic void setDocumentLocator(Locator locator)
handler
.setDocumentLocator
in interface ContentHandler
setDocumentLocator
in class DefaultHandler
locator
- passed throughpublic void skippedEntity(String name) throws SAXException
handler
.skippedEntity
in interface ContentHandler
skippedEntity
in class DefaultHandler
name
- passed throughSAXException
- if an error occurspublic void startDocument() throws SAXException
handler
.startDocument
in interface ContentHandler
startDocument
in class DefaultHandler
SAXException
- if an error occurspublic void startElement(String namespaceURI, String localName, String qName, Attributes atts) throws SAXException
handler
.startElement
in interface ContentHandler
startElement
in class DefaultHandler
namespaceURI
- passed throughlocalName
- passed throughqName
- passed throughatts
- passed throughSAXException
- if an error occurspublic void startPrefixMapping(String prefix, String uri) throws SAXException
handler
.startPrefixMapping
in interface ContentHandler
startPrefixMapping
in class DefaultHandler
prefix
- passed throughuri
- passed throughSAXException
- if an error occursCopyright © 2004–2024 The Apache Software Foundation. All rights reserved.