Team LiB
Previous Section Next Section

XMLFilterImplorg.xml.sax.helpers

Java 1.4

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.

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 org.xml.sax.SAXException;  
     public void endDocument( ) throws org.xml.sax.SAXException;  
     public void endElement(String uri, String localName, String qName) 
        throws org.xml.sax.SAXException;  
     public void endPrefixMapping(String prefix) throws org.xml.sax.SAXException;  
     public void ignorableWhitespace(char[ ] ch, int start, int length) 
        throws org.xml.sax.SAXException;  
     public void processingInstruction(String target, String data) 
        throws org.xml.sax.SAXException;  
     public void setDocumentLocator(org.xml.sax.Locator locator);  
     public void skippedEntity(String name) throws org.xml.sax.SAXException;  
     public void startDocument( ) throws org.xml.sax.SAXException;  
     public void startElement(String uri, String localName, String qName, 
        org.xml.sax.Attributes atts) throws org.xml.sax.SAXException;  
     public void startPrefixMapping(String prefix, String uri) 
        throws org.xml.sax.SAXException;  
// Methods Implementing DTDHandler
     public void notationDecl(String name, String publicId, String systemId) 
        throws org.xml.sax.SAXException;  
     public void unparsedEntityDecl(String name, String publicId, String systemId, 
        String notationName) throws org.xml.sax.SAXException;  
// Methods Implementing EntityResolver
     public org.xml.sax.InputSource resolveEntity(String publicId, String systemId) 
        throws org.xml.sax.SAXException, java.io.IOException;  
// Methods Implementing ErrorHandler
     public void error(org.xml.sax.SAXParseException e) 
       throws org.xml.sax.SAXException;  
     public void fatalError(org.xml.sax.SAXParseException e) 
        throws org.xml.sax.SAXException;  
     public void warning(org.xml.sax.SAXParseException e) throws org.xml.sax.SAXException;  
// Methods Implementing XMLFilter
     public org.xml.sax.XMLReader getParent( );                           default:null
     public void setParent(org.xml.sax.XMLReader parent);  
// Methods Implementing XMLReader
     public org.xml.sax.ContentHandler getContentHandler( );              default:null
     public org.xml.sax.DTDHandler getDTDHandler( );                      default:null
     public org.xml.sax.EntityResolver getEntityResolver( );              default:null
     public org.xml.sax.ErrorHandler getErrorHandler( );                  default:null
     public boolean getFeature(String name) 
        throws org.xml.sax.SAXNotRecognizedException, 
        org.xml.sax.SAXNotSupportedException;  
     public Object getProperty(String name) 
        throws org.xml.sax.SAXNotRecognizedException, 
        org.xml.sax.SAXNotSupportedException;  
     public void parse(String systemId) throws org.xml.sax.SAXException, 
        java.io.IOException;  
     public void parse(org.xml.sax.InputSource input) throws org.xml.sax.SAXException, 
        java.io.IOException;  
     public void setContentHandler(org.xml.sax.ContentHandler handler);  
     public void setDTDHandler(org.xml.sax.DTDHandler handler);  
     public void setEntityResolver(org.xml.sax.EntityResolver resolver);  
     public void setErrorHandler(org.xml.sax.ErrorHandler handler);  
     public void setFeature(String name, boolean value) 
throws org.xml.sax.SAXNotRecognizedException, org.xml.sax.SAXNotSupportedException;  
     public void setProperty(String name, Object value) 
throws org.xml.sax.SAXNotRecognizedException, org.xml.sax.SAXNotSupportedException;  
}

    Team LiB
    Previous Section Next Section