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
ConstructorsConstructorDescriptionMain constructor.DelegatingContentHandler(ContentHandler handler) Convenience constructor. -
Method Summary
Modifier and TypeMethodDescriptionvoidcharacters(char[] ch, int start, int length) voidcomment(char[] ch, int start, int length) voidendCDATA()voidvoidendDTD()voidendElement(String uri, String localName, String qName) voidvoidendPrefixMapping(String prefix) voiderror(SAXParseException exception) voidfatalError(SAXParseException exception) voidignorableWhitespace(char[] ch, int start, int length) voidnotationDecl(String name, String publicId, String systemId) voidprocessingInstruction(String target, String data) resolveEntity(String publicId, String systemId) voidsetDelegateContentHandler(ContentHandler handler) Sets the delegate ContentHandler that all events are forwarded to.voidsetDelegateDTDHandler(DTDHandler handler) Sets the delegate DTDHandler.voidsetDelegateEntityResolver(EntityResolver resolver) Sets the delegate EntityResolver.voidsetDelegateErrorHandler(ErrorHandler handler) Sets the delegate ErrorHandler.voidsetDelegateLexicalHandler(LexicalHandler handler) Sets the delegate LexicalHandler.voidsetDocumentLocator(Locator locator) voidskippedEntity(String name) voidvoidvoidvoidstartElement(String uri, String localName, String qName, Attributes atts) voidstartEntity(String name) voidstartPrefixMapping(String prefix, String uri) voidunparsedEntityDecl(String name, String publicId, String systemId, String notationName) voidwarning(SAXParseException exception) Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods 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:
resolveEntityin interfaceEntityResolver- Throws:
SAXExceptionIOException
-
notationDecl
- Specified by:
notationDeclin interfaceDTDHandler- Throws:
SAXException
-
unparsedEntityDecl
public void unparsedEntityDecl(String name, String publicId, String systemId, String notationName) throws SAXException - Specified by:
unparsedEntityDeclin interfaceDTDHandler- Throws:
SAXException
-
setDocumentLocator
- Specified by:
setDocumentLocatorin interfaceContentHandler
-
startDocument
- Specified by:
startDocumentin interfaceContentHandler- Throws:
SAXException
-
endDocument
- Specified by:
endDocumentin interfaceContentHandler- Throws:
SAXException
-
startPrefixMapping
- Specified by:
startPrefixMappingin interfaceContentHandler- Throws:
SAXException
-
endPrefixMapping
- Specified by:
endPrefixMappingin interfaceContentHandler- Throws:
SAXException
-
startElement
public void startElement(String uri, String localName, String qName, Attributes atts) throws SAXException - Specified by:
startElementin interfaceContentHandler- Throws:
SAXException
-
endElement
- Specified by:
endElementin interfaceContentHandler- Throws:
SAXException
-
characters
- Specified by:
charactersin interfaceContentHandler- Throws:
SAXException
-
ignorableWhitespace
- Specified by:
ignorableWhitespacein interfaceContentHandler- Throws:
SAXException
-
processingInstruction
- Specified by:
processingInstructionin interfaceContentHandler- Throws:
SAXException
-
skippedEntity
- Specified by:
skippedEntityin interfaceContentHandler- Throws:
SAXException
-
startDTD
- Specified by:
startDTDin interfaceLexicalHandler- Throws:
SAXException
-
endDTD
- Specified by:
endDTDin interfaceLexicalHandler- Throws:
SAXException
-
startEntity
- Specified by:
startEntityin interfaceLexicalHandler- Throws:
SAXException
-
endEntity
- Specified by:
endEntityin interfaceLexicalHandler- Throws:
SAXException
-
startCDATA
- Specified by:
startCDATAin interfaceLexicalHandler- Throws:
SAXException
-
endCDATA
- Specified by:
endCDATAin interfaceLexicalHandler- Throws:
SAXException
-
comment
- Specified by:
commentin interfaceLexicalHandler- Throws:
SAXException
-
warning
- Specified by:
warningin interfaceErrorHandler- Throws:
SAXException
-
error
- Specified by:
errorin interfaceErrorHandler- Throws:
SAXException
-
fatalError
- Specified by:
fatalErrorin interfaceErrorHandler- Throws:
SAXException
-