KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > apache > commons > digester > RuleSet


1 /* $Id: RuleSet.java 155412 2005-02-26 12:58:36Z dirkv $
2  *
3  * Copyright 2001-2004 The Apache Software Foundation.
4  *
5  * Licensed under the Apache License, Version 2.0 (the "License");
6  * you may not use this file except in compliance with the License.
7  * 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 package org.apache.commons.digester;
19
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
41     // ------------------------------------------------------------- Properties
42

43
44     /**
45      * Return the namespace URI that will be applied to all Rule instances
46      * created from this RuleSet.
47      */

48     public String JavaDoc getNamespaceURI();
49
50
51     // --------------------------------------------------------- Public Methods
52

53
54     /**
55      * Add the set of Rule instances defined in this RuleSet to the
56      * specified <code>Digester</code> instance, associating them with
57      * our namespace URI (if any). This method should only be called
58      * by a Digester instance.
59      *
60      * @param digester Digester instance to which the new Rule instances
61      * should be added.
62      */

63     public void addRuleInstances(Digester digester);
64
65
66 }
67
Popular Tags