Source for org.xml.sax.XMLFilter

   1: // XMLFilter.java - filter SAX2 events.
   2: // http://www.saxproject.org
   3: // Written by David Megginson
   4: // NO WARRANTY!  This class is in the Public Domain.
   5: // $Id: XMLFilter.java,v 1.1 2004/12/23 22:38:42 mark Exp $
   6: 
   7: package org.xml.sax;
   8: 
   9: 
  10: /**
  11:  * Interface for an XML filter.
  12:  *
  13:  * <blockquote>
  14:  * <em>This module, both source code and documentation, is in the
  15:  * Public Domain, and comes with <strong>NO WARRANTY</strong>.</em>
  16:  * See <a href='http://www.saxproject.org'>http://www.saxproject.org</a>
  17:  * for further information.
  18:  * </blockquote>
  19:  *
  20:  * <p>An XML filter is like an XML reader, except that it obtains its
  21:  * events from another XML reader rather than a primary source like
  22:  * an XML document or database.  Filters can modify a stream of
  23:  * events as they pass on to the final application.</p>
  24:  *
  25:  * <p>The XMLFilterImpl helper class provides a convenient base
  26:  * for creating SAX2 filters, by passing on all {@link org.xml.sax.EntityResolver
  27:  * EntityResolver}, {@link org.xml.sax.DTDHandler DTDHandler},
  28:  * {@link org.xml.sax.ContentHandler ContentHandler} and {@link org.xml.sax.ErrorHandler
  29:  * ErrorHandler} events automatically.</p>
  30:  *
  31:  * @since SAX 2.0
  32:  * @author David Megginson
  33:  * @version 2.0.1 (sax2r2)
  34:  * @see org.xml.sax.helpers.XMLFilterImpl
  35:  */
  36: public interface XMLFilter extends XMLReader
  37: {
  38: 
  39:     /**
  40:      * Set the parent reader.
  41:      *
  42:      * <p>This method allows the application to link the filter to
  43:      * a parent reader (which may be another filter).  The argument
  44:      * may not be null.</p>
  45:      *
  46:      * @param parent The parent reader.
  47:      */
  48:     public abstract void setParent (XMLReader parent);
  49: 
  50: 
  51:     /**
  52:      * Get the parent reader.
  53:      *
  54:      * <p>This method allows the application to query the parent
  55:      * reader (which may be another filter).  It is generally a
  56:      * bad idea to perform any operations on the parent reader
  57:      * directly: they should all pass through this filter.</p>
  58:      *
  59:      * @return The parent filter, or null if none has been set.
  60:      */
  61:     public abstract XMLReader getParent ();
  62: 
  63: }
  64: 
  65: // end of XMLFilter.java