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
9
* http://www.apache.org/licenses/LICENSE-2.0
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.
19
package org.apache.catalina.startup;
22
import org.apache.tomcat.util.digester.Digester;
23
import org.apache.tomcat.util.digester.RuleSetBase;
27
* <p><strong>RuleSet</strong> for processing the contents of a Realm definition
28
* element. This <code>RuleSet</code> supports Realms such as the
29
* <code>CombinedRealm</code> that used nested Realms.</p>
31
* @version $Revision: 707757 $ $Date: 2008-10-24 23:54:48 +0200 (Fri, 24 Oct 2008) $
34
public class RealmRuleSet extends RuleSetBase {
37
// ----------------------------------------------------- Instance Variables
41
* The matching pattern prefix to use for recognizing our elements.
43
protected String prefix = null;
46
// ------------------------------------------------------------ Constructor
50
* Construct an instance of this <code>RuleSet</code> with the default
51
* matching pattern prefix.
53
public RealmRuleSet() {
61
* Construct an instance of this <code>RuleSet</code> with the specified
62
* matching pattern prefix.
64
* @param prefix Prefix for matching pattern rules (including the
65
* trailing slash character)
67
public RealmRuleSet(String prefix) {
70
this.namespaceURI = null;
76
// --------------------------------------------------------- Public Methods
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>
85
* @param digester Digester instance to which the new Rule instances
88
public void addRuleInstances(Digester digester) {
90
digester.addObjectCreate(prefix + "Realm",
91
null, // MUST be specified in the element,
93
digester.addSetProperties(prefix + "Realm");
94
digester.addSetNext(prefix + "Realm",
96
"org.apache.catalina.Realm");
98
digester.addObjectCreate(prefix + "Realm/Realm",
99
null, // MUST be specified in the element
101
digester.addSetProperties(prefix + "Realm/Realm");
102
digester.addSetNext(prefix + "Realm/Realm",
104
"org.apache.catalina.Realm");