Package org.apache.fop.util
Class DelegatingContentHandler
java.lang.Object
org.apache.fop.util.DelegatingContentHandler
- All Implemented Interfaces:
ContentHandler
,DTDHandler
,EntityResolver
,ErrorHandler
,LexicalHandler
- Direct Known Subclasses:
DelegatingFragmentContentHandler
,GenerationHelperContentHandler
public class DelegatingContentHandler
extends Object
implements EntityResolver, DTDHandler, ContentHandler, LexicalHandler, ErrorHandler
SAX 2 Event Handler which simply delegates all calls to another ContentHandler. Subclasses can
do additional processing. This class is the passive counterpart to XMLFilterImpl.
The ContentHandler is the only instance that is required. All others (DTDHandler, EntityResolver, LexicalHandler and ErrorHandler) may be ignored.
-
Constructor Summary
ConstructorDescriptionMain constructor.DelegatingContentHandler
(ContentHandler handler) Convenience constructor. -
Method Summary
Modifier and TypeMethodDescriptionvoid
characters
(char[] ch, int start, int length) void
comment
(char[] ch, int start, int length) void
endCDATA()
void
void
endDTD()
void
endElement
(String uri, String localName, String qName) void
void
endPrefixMapping
(String prefix) void
error
(SAXParseException exception) void
fatalError
(SAXParseException exception) void
ignorableWhitespace
(char[] ch, int start, int length) void
notationDecl
(String name, String publicId, String systemId) void
processingInstruction
(String target, String data) 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
void
void
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) Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.xml.sax.ContentHandler
declaration
-
Constructor Details
-
DelegatingContentHandler
public DelegatingContentHandler()Main constructor. -
DelegatingContentHandler
Convenience constructor. If the given handler also implements any of the EntityResolver, DTDHandler, LexicalHandler or ErrorHandler interfaces, these are set automatically.- Parameters:
handler
- the content handler to delegate to
-
-
Method Details
-
getDelegateContentHandler
- Returns:
- the delegate that all ContentHandler events are forwarded to
-
setDelegateContentHandler
Sets the delegate ContentHandler that all events are forwarded to.- Parameters:
handler
- the delegate instance
-
setDelegateEntityResolver
Sets the delegate EntityResolver.- Parameters:
resolver
- the delegate instance
-
setDelegateDTDHandler
Sets the delegate DTDHandler.- Parameters:
handler
- the delegate instance
-
setDelegateLexicalHandler
Sets the delegate LexicalHandler.- Parameters:
handler
- the delegate instance
-
setDelegateErrorHandler
Sets the delegate ErrorHandler.- Parameters:
handler
- the delegate instance
-
resolveEntity
- Specified by:
resolveEntity
in interfaceEntityResolver
- Throws:
SAXException
IOException
-
notationDecl
- Specified by:
notationDecl
in interfaceDTDHandler
- Throws:
SAXException
-
unparsedEntityDecl
public void unparsedEntityDecl(String name, String publicId, String systemId, String notationName) throws SAXException - Specified by:
unparsedEntityDecl
in interfaceDTDHandler
- Throws:
SAXException
-
setDocumentLocator
- Specified by:
setDocumentLocator
in interfaceContentHandler
-
startDocument
- Specified by:
startDocument
in interfaceContentHandler
- Throws:
SAXException
-
endDocument
- Specified by:
endDocument
in interfaceContentHandler
- Throws:
SAXException
-
startPrefixMapping
- Specified by:
startPrefixMapping
in interfaceContentHandler
- Throws:
SAXException
-
endPrefixMapping
- Specified by:
endPrefixMapping
in interfaceContentHandler
- Throws:
SAXException
-
startElement
public void startElement(String uri, String localName, String qName, Attributes atts) throws SAXException - Specified by:
startElement
in interfaceContentHandler
- Throws:
SAXException
-
endElement
- Specified by:
endElement
in interfaceContentHandler
- Throws:
SAXException
-
characters
- Specified by:
characters
in interfaceContentHandler
- Throws:
SAXException
-
ignorableWhitespace
- Specified by:
ignorableWhitespace
in interfaceContentHandler
- Throws:
SAXException
-
processingInstruction
- Specified by:
processingInstruction
in interfaceContentHandler
- Throws:
SAXException
-
skippedEntity
- Specified by:
skippedEntity
in interfaceContentHandler
- Throws:
SAXException
-
startDTD
- Specified by:
startDTD
in interfaceLexicalHandler
- Throws:
SAXException
-
endDTD
- Specified by:
endDTD
in interfaceLexicalHandler
- Throws:
SAXException
-
startEntity
- Specified by:
startEntity
in interfaceLexicalHandler
- Throws:
SAXException
-
endEntity
- Specified by:
endEntity
in interfaceLexicalHandler
- Throws:
SAXException
-
startCDATA
- Specified by:
startCDATA
in interfaceLexicalHandler
- Throws:
SAXException
-
endCDATA
- Specified by:
endCDATA
in interfaceLexicalHandler
- Throws:
SAXException
-
comment
- Specified by:
comment
in interfaceLexicalHandler
- Throws:
SAXException
-
warning
- Specified by:
warning
in interfaceErrorHandler
- Throws:
SAXException
-
error
- Specified by:
error
in interfaceErrorHandler
- Throws:
SAXException
-
fatalError
- Specified by:
fatalError
in interfaceErrorHandler
- Throws:
SAXException
-