1 package net.sf.tomp.xtcl.filter;
2
3 import org.apache.commons.logging.Log;
4 import org.apache.commons.logging.LogFactory;
5 import org.xml.sax.SAXException;
6 import org.xml.sax.XMLFilter;
7 import org.xml.sax.XMLReader;
8
9 import java.util.List;
10
11 /***
12 * A trial MultiFilter for testing purposes.
13 *
14 * @author tomp
15 */
16 public class MyMultiFilter extends DynamicMultiFilterImpl {
17 private Log log = LogFactory.getLog(MyMultiFilter.class);
18
19
20
21
22 public MyMultiFilter() throws SAXException {
23 super();
24 setupFilters();
25 }
26
27 /***
28 * Creates a new MyMultiFilter object.
29 *
30 * @param parent DOCUMENT ME!
31 * @throws SAXException DOCUMENT ME!
32 */
33 public MyMultiFilter(XMLReader parent) throws SAXException {
34 super(parent);
35 setupFilters();
36 }
37
38 /***
39 * DOCUMENT ME!
40 *
41 * @throws SAXException DOCUMENT ME!
42 */
43 protected void setupFilters() throws SAXException {
44 XMLFilter f1 = new org.xml.sax.helpers.XMLFilterImpl();
45
46 addFilter(0, f1);
47 log.debug("+++ added at 0 " + f1);
48
49 XMLFilter f2 = new net.sf.tomp.xtcl.filter.XTFilterImpl();
50
51 addFilter(0, f2);
52 log.debug("+++ added at 0 " + f2);
53
54 XMLFilter f3 = new net.sf.tomp.xtcl.filter.XTFilterImpl();
55
56 addFilter(2, f3);
57 log.debug("+++ added at 2 " + f3);
58 log.debug("+++ filters: " + getFilters());
59
60
61
62
63
64
65
66
67
68
69 }
70
71 /***
72 * DOCUMENT ME!
73 *
74 * @return DOCUMENT ME!
75 */
76 public List getFilters() {
77 return filters;
78 }
79 }
80
81
82
83
84
85
86
87
88
89
90