01: /* $Id: RuleSet.java 467222 2006-10-24 03:17:11Z markt $
02: *
03: * Licensed to the Apache Software Foundation (ASF) under one or more
04: * contributor license agreements. See the NOTICE file distributed with
05: * this work for additional information regarding copyright ownership.
06: * The ASF licenses this file to You under the Apache License, Version 2.0
07: * (the "License"); you may not use this file except in compliance with
08: * the License. You may obtain a copy of the License at
09: *
10: * http://www.apache.org/licenses/LICENSE-2.0
11: *
12: * Unless required by applicable law or agreed to in writing, software
13: * distributed under the License is distributed on an "AS IS" BASIS,
14: * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15: * See the License for the specific language governing permissions and
16: * limitations under the License.
17: */
18:
19: package org.apache.tomcat.util.digester;
20:
21: /**
22: * <p>Public interface defining a shorthand means of configuring a complete
23: * set of related <code>Rule</code> definitions, possibly associated with
24: * a particular namespace URI, in one operation. To use an instance of a
25: * class that imlements this interface:</p>
26: * <ul>
27: * <li>Create a concrete implementation of this interface.</li>
28: * <li>Optionally, you can configure a <code>RuleSet</code> to be relevant
29: * only for a particular namespace URI by configuring the value to be
30: * returned by <code>getNamespaceURI()</code>.</li>
31: * <li>As you are configuring your Digester instance, call
32: * <code>digester.addRuleSet()</code> and pass the RuleSet instance.</li>
33: * <li>Digester will call the <code>addRuleInstances()</code> method of
34: * your RuleSet to configure the necessary rules.</li>
35: * </ul>
36: */
37:
38: public interface RuleSet {
39:
40: // ------------------------------------------------------------- Properties
41:
42: /**
43: * Return the namespace URI that will be applied to all Rule instances
44: * created from this RuleSet.
45: */
46: public String getNamespaceURI();
47:
48: // --------------------------------------------------------- Public Methods
49:
50: /**
51: * Add the set of Rule instances defined in this RuleSet to the
52: * specified <code>Digester</code> instance, associating them with
53: * our namespace URI (if any). This method should only be called
54: * by a Digester instance.
55: *
56: * @param digester Digester instance to which the new Rule instances
57: * should be added.
58: */
59: public void addRuleInstances(Digester digester);
60:
61: }
|