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