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