public class DelegatingContentHandler extends Object implements EntityResolver, DTDHandler, ContentHandler, LexicalHandler, ErrorHandler
The ContentHandler is the only instance that is required. All others (DTDHandler, EntityResolver, LexicalHandler and ErrorHandler) may be ignored.
| Constructor and Description |
|---|
DelegatingContentHandler()
Main constructor.
|
DelegatingContentHandler(ContentHandler handler)
Convenience constructor.
|
| Modifier and Type | Method and Description |
|---|---|
void |
characters(char[] ch,
int start,
int length) |
void |
comment(char[] ch,
int start,
int length) |
void |
endCDATA() |
void |
endDocument() |
void |
endDTD() |
void |
endElement(String uri,
String localName,
String qName) |
void |
endEntity(String name) |
void |
endPrefixMapping(String prefix) |
void |
error(SAXParseException exception) |
void |
fatalError(SAXParseException exception) |
ContentHandler |
getDelegateContentHandler() |
void |
ignorableWhitespace(char[] ch,
int start,
int length) |
void |
notationDecl(String name,
String publicId,
String systemId) |
void |
processingInstruction(String target,
String data) |
InputSource |
resolveEntity(String publicId,
String systemId) |
void |
setDelegateContentHandler(ContentHandler handler)
Sets the delegate ContentHandler that all events are forwarded to.
|
void |
setDelegateDTDHandler(DTDHandler handler)
Sets the delegate DTDHandler.
|
void |
setDelegateEntityResolver(EntityResolver resolver)
Sets the delegate EntityResolver.
|
void |
setDelegateErrorHandler(ErrorHandler handler)
Sets the delegate ErrorHandler.
|
void |
setDelegateLexicalHandler(LexicalHandler handler)
Sets the delegate LexicalHandler.
|
void |
setDocumentLocator(Locator locator) |
void |
skippedEntity(String name) |
void |
startCDATA() |
void |
startDocument() |
void |
startDTD(String name,
String publicId,
String systemId) |
void |
startElement(String uri,
String localName,
String qName,
Attributes atts) |
void |
startEntity(String name) |
void |
startPrefixMapping(String prefix,
String uri) |
void |
unparsedEntityDecl(String name,
String publicId,
String systemId,
String notationName) |
void |
warning(SAXParseException exception) |
public DelegatingContentHandler()
public DelegatingContentHandler(ContentHandler handler)
handler - the content handler to delegate topublic ContentHandler getDelegateContentHandler()
public void setDelegateContentHandler(ContentHandler handler)
handler - the delegate instancepublic void setDelegateEntityResolver(EntityResolver resolver)
resolver - the delegate instancepublic void setDelegateDTDHandler(DTDHandler handler)
handler - the delegate instancepublic void setDelegateLexicalHandler(LexicalHandler handler)
handler - the delegate instancepublic void setDelegateErrorHandler(ErrorHandler handler)
handler - the delegate instancepublic InputSource resolveEntity(String publicId, String systemId) throws SAXException, IOException
resolveEntity in interface EntityResolverSAXExceptionIOExceptionpublic void notationDecl(String name, String publicId, String systemId) throws SAXException
notationDecl in interface DTDHandlerSAXExceptionpublic void unparsedEntityDecl(String name, String publicId, String systemId, String notationName) throws SAXException
unparsedEntityDecl in interface DTDHandlerSAXExceptionpublic void setDocumentLocator(Locator locator)
setDocumentLocator in interface ContentHandlerpublic void startDocument()
throws SAXException
startDocument in interface ContentHandlerSAXExceptionpublic void endDocument()
throws SAXException
endDocument in interface ContentHandlerSAXExceptionpublic void startPrefixMapping(String prefix, String uri) throws SAXException
startPrefixMapping in interface ContentHandlerSAXExceptionpublic void endPrefixMapping(String prefix) throws SAXException
endPrefixMapping in interface ContentHandlerSAXExceptionpublic void startElement(String uri, String localName, String qName, Attributes atts) throws SAXException
startElement in interface ContentHandlerSAXExceptionpublic void endElement(String uri, String localName, String qName) throws SAXException
endElement in interface ContentHandlerSAXExceptionpublic void characters(char[] ch,
int start,
int length)
throws SAXException
characters in interface ContentHandlerSAXExceptionpublic void ignorableWhitespace(char[] ch,
int start,
int length)
throws SAXException
ignorableWhitespace in interface ContentHandlerSAXExceptionpublic void processingInstruction(String target, String data) throws SAXException
processingInstruction in interface ContentHandlerSAXExceptionpublic void skippedEntity(String name) throws SAXException
skippedEntity in interface ContentHandlerSAXExceptionpublic void startDTD(String name, String publicId, String systemId) throws SAXException
startDTD in interface LexicalHandlerSAXExceptionpublic void endDTD()
throws SAXException
endDTD in interface LexicalHandlerSAXExceptionpublic void startEntity(String name) throws SAXException
startEntity in interface LexicalHandlerSAXExceptionpublic void endEntity(String name) throws SAXException
endEntity in interface LexicalHandlerSAXExceptionpublic void startCDATA()
throws SAXException
startCDATA in interface LexicalHandlerSAXExceptionpublic void endCDATA()
throws SAXException
endCDATA in interface LexicalHandlerSAXExceptionpublic void comment(char[] ch,
int start,
int length)
throws SAXException
comment in interface LexicalHandlerSAXExceptionpublic void warning(SAXParseException exception) throws SAXException
warning in interface ErrorHandlerSAXExceptionpublic void error(SAXParseException exception) throws SAXException
error in interface ErrorHandlerSAXExceptionpublic void fatalError(SAXParseException exception) throws SAXException
fatalError in interface ErrorHandlerSAXExceptionCopyright © 2025 Apache Software Foundation. All rights reserved.