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