Name

XMLFilterImpl

Synopsis

This class is implements an XMLFilter that does no filtering. You can subclass it to override whatever methods are required to perform the type of filtering you desire.

XMLFilterImpl implements ContentHandler, ErrorHandler, EntityResolver, and DTDHandler so that it can receive SAX events from the “parent” XMLReader object. But it also implements the XMLFilter interface, which is an extension of XMLReader, so that it acts as an XMLReader itself, and can send SAX events to the handler objects that are registered on it. Each of the handler methods of this class simply invoke the corresponding method of the corresponding handler that was registered on the filter. The XMLReader methods for getting and setting features and properties simply invoke the corresponding method of the parent XMLReader object. The parse( ) methods do the same thing: they pass their argument to the corresponding parse( ) method of the parent reader to start the parsing process.

org.xml.sax.helpers.XMLFilterImpl

Figure 22-18. org.xml.sax.helpers.XMLFilterImpl

public class XMLFilterImpl 
implements org.xml.sax.ContentHandler, org.xml.sax.DTDHandler, 
        org.xml.sax.EntityResolver, org.xml.sax.ErrorHandler, org.xml.sax.XMLFilter {
// Public Constructors
     public XMLFilterImpl( );  
     public XMLFilterImpl(org.xml.sax.XMLReader parent);  
// Methods Implementing ContentHandler
     public void characters(char[ ] ch, int start, int length) throws ...

Get Java in a Nutshell, 5th Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.