KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > apache > catalina > startup > TldRuleSet


1 /*
2  * Licensed to the Apache Software Foundation (ASF) under one or more
3  * contributor license agreements. See the NOTICE file distributed with
4  * this work for additional information regarding copyright ownership.
5  * The ASF licenses this file to You under the Apache License, Version 2.0
6  * (the "License"); you may not use this file except in compliance with
7  * the License. You may obtain a copy of the License at
8  *
9  * 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
19 package org.apache.catalina.startup;
20
21
22 import org.apache.tomcat.util.digester.Digester;
23 import org.apache.tomcat.util.digester.RuleSetBase;
24
25
26 /**
27  * <p><strong>RuleSet</strong> for processing the contents of a tag library
28  * descriptor resource.</p>
29  *
30  * @author Craig R. McClanahan
31  * @version $Revision: 467222 $ $Date: 2006-10-24 05:17:11 +0200 (mar., 24 oct. 2006) $
32  */

33
34 public class TldRuleSet extends RuleSetBase {
35
36
37     // ----------------------------------------------------- Instance Variables
38

39
40     /**
41      * The matching pattern prefix to use for recognizing our elements.
42      */

43     protected String JavaDoc prefix = null;
44
45
46     // ------------------------------------------------------------ Constructor
47

48
49     /**
50      * Construct an instance of this <code>RuleSet</code> with the default
51      * matching pattern prefix.
52      */

53     public TldRuleSet() {
54
55         this("");
56
57     }
58
59
60     /**
61      * Construct an instance of this <code>RuleSet</code> with the specified
62      * matching pattern prefix.
63      *
64      * @param prefix Prefix for matching pattern rules (including the
65      * trailing slash character)
66      */

67     public TldRuleSet(String JavaDoc prefix) {
68
69         super();
70         this.namespaceURI = null;
71         this.prefix = prefix;
72
73     }
74
75
76     // --------------------------------------------------------- Public Methods
77

78
79     /**
80      * <p>Add the set of Rule instances defined in this RuleSet to the
81      * specified <code>Digester</code> instance, associating them with
82      * our namespace URI (if any). This method should only be called
83      * by a Digester instance.</p>
84      *
85      * @param digester Digester instance to which the new Rule instances
86      * should be added.
87      */

88     public void addRuleInstances(Digester digester) {
89
90         digester.addCallMethod(prefix + "taglib/listener/listener-class",
91                                "addApplicationListener", 0);
92
93     }
94
95
96 }
97
Popular Tags