Name

The XMLFilterImpl Class

Synopsis

XMLFilterImpl is invaluable for implementing XML filters correctly. An instance of this class sits between an XMLReader and the client application's event handlers. It receives messages from the reader and passes them to the application unchanged, and vice versa. However, by subclassing this class and overriding particular methods, you can change the events that are sent before the application gets to see them. You chain a filter to an XMLReader by passing the reader as an argument to the filter's constructor. When parsing, you invoke the filter's parse( ) method, not the reader's parse( ) method.

package org.xml.sax.helpers;
     
public class XMLFilterImpl implements XMLFilter, EntityResolver,
 DTDHandler, ContentHandler, ErrorHandler {
     
  public XMLFilterImpl(  );
  public XMLFilterImpl(XMLReader parent);
     
  // Implementation of org.xml.sax.XMLFilter
  public void      setParent(XMLReader parent);
  public XMLReader getParent(  );
     
  // Implementation of org.xml.sax.XMLReader
  public void           setFeature(String name, boolean state)
   throws SAXNotRecognizedException, SAXNotSupportedException;
  public boolean        getFeature(String name)
   throws SAXNotRecognizedException, SAXNotSupportedException;
  public void           setProperty(String name, Object value)
   throws SAXNotRecognizedException, SAXNotSupportedException;
  public Object         getProperty(String name)
   throws SAXNotRecognizedException, SAXNotSupportedException;
  public void           setEntityResolver(EntityResolver resolver);
  public EntityResolver getEntityResolver(  );
  public void           setDTDHandler(DTDHandler handler);
  public DTDHandler     getDTDHandler(  );
  public void           setContentHandler(ContentHandler handler);
  public ContentHandler getContentHandler(  );
  public void           setErrorHandler(ErrorHandler handler);
  public ErrorHandler   getErrorHandler(  );
  public void parse(InputSource input) throws SAXException, IOException;
  public void parse(String systemID) throws SAXException, IOException
     
  // Implementation of org.xml.sax.EntityResolver
  public InputSource resolveEntity(String publicID, String systemID)
   throws SAXException, IOException;
     
  // Implementation of org.xml.sax.DTDHandler
  public void notationDecl(String name, String publicID, String systemID)
   throws SAXException;
  public void unparsedEntityDecl(String name, String publicID,
   String systemID, String notationName) throws SAXException;
     
  // Implementation of org.xml.sax.ContentHandler
  public void setDocumentLocator(Locator locator);
  public void startDocument(  ) throws SAXException;
  public void endDocument(  ) throws SAXException;
  public void startPrefixMapping(String prefix, String uri)
   throws SAXException;
  public void endPrefixMapping(String prefix) throws SAXException;
  public void startElement(String namespaceURI, String localName,
   String qualifiedName, Attributes atts) throws SAXException;
  public void endElement(String namespaceURI, String localName,
   String qualifiedName) throws SAXException;
  public void characters(char[  ] text, int start, int length)
   throws SAXException;
  public void ignorableWhitespace(char[  ] text, int start, int length)
   throws SAXException;
  public void processingInstruction(String target, String data)
   throws SAXException;
  public void skippedEntity(String name) throws SAXException;
     
  // Implementation of org.xml.sax.ErrorHandler
  public void warning(SAXParseException ex) throws SAXException;
  public void error(SAXParseException ex) throws SAXException;
  public void fatalError(SAXParseException ex) throws SAXException;
     
}