01: /*
02: * Copyright 1999-2001,2004 The Apache Software Foundation.
03: *
04: * Licensed under the Apache License, Version 2.0 (the "License");
05: * you may not use this file except in compliance with the License.
06: * You may obtain a copy of the License at
07: *
08: * http://www.apache.org/licenses/LICENSE-2.0
09: *
10: * Unless required by applicable law or agreed to in writing, software
11: * distributed under the License is distributed on an "AS IS" BASIS,
12: * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13: * See the License for the specific language governing permissions and
14: * limitations under the License.
15: */
16:
17: package org.apache.catalina.startup;
18:
19: import org.apache.commons.digester.Digester;
20: import org.apache.commons.digester.RuleSetBase;
21:
22: /**
23: * <p><strong>RuleSet</strong> for processing the contents of a tag library
24: * descriptor resource.</p>
25: *
26: * @author Craig R. McClanahan
27: * @version $Revision: 1.3 $ $Date: 2004/02/27 14:58:49 $
28: */
29:
30: public class TldRuleSet extends RuleSetBase {
31:
32: // ----------------------------------------------------- Instance Variables
33:
34: /**
35: * The matching pattern prefix to use for recognizing our elements.
36: */
37: protected String prefix = null;
38:
39: // ------------------------------------------------------------ Constructor
40:
41: /**
42: * Construct an instance of this <code>RuleSet</code> with the default
43: * matching pattern prefix.
44: */
45: public TldRuleSet() {
46:
47: this ("");
48:
49: }
50:
51: /**
52: * Construct an instance of this <code>RuleSet</code> with the specified
53: * matching pattern prefix.
54: *
55: * @param prefix Prefix for matching pattern rules (including the
56: * trailing slash character)
57: */
58: public TldRuleSet(String prefix) {
59:
60: super ();
61: this .namespaceURI = null;
62: this .prefix = prefix;
63:
64: }
65:
66: // --------------------------------------------------------- Public Methods
67:
68: /**
69: * <p>Add the set of Rule instances defined in this RuleSet to the
70: * specified <code>Digester</code> instance, associating them with
71: * our namespace URI (if any). This method should only be called
72: * by a Digester instance.</p>
73: *
74: * @param digester Digester instance to which the new Rule instances
75: * should be added.
76: */
77: public void addRuleInstances(Digester digester) {
78:
79: digester.addCallMethod(prefix
80: + "taglib/listener/listener-class",
81: "addApplicationListener", 0);
82:
83: }
84:
85: }
|