001 /* $Id: RuleSet.java 992060 2010-09-02 19:09:47Z simonetripodi $
002 *
003 * Licensed to the Apache Software Foundation (ASF) under one or more
004 * contributor license agreements. See the NOTICE file distributed with
005 * this work for additional information regarding copyright ownership.
006 * The ASF licenses this file to You under the Apache License, Version 2.0
007 * (the "License"); you may not use this file except in compliance with
008 * the License. You may obtain a copy of the License at
009 *
010 * http://www.apache.org/licenses/LICENSE-2.0
011 *
012 * Unless required by applicable law or agreed to in writing, software
013 * distributed under the License is distributed on an "AS IS" BASIS,
014 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
015 * See the License for the specific language governing permissions and
016 * limitations under the License.
017 */
018
019 package org.apache.commons.digester;
020
021
022 /**
023 * <p>Public interface defining a shorthand means of configuring a complete
024 * set of related <code>Rule</code> definitions, possibly associated with
025 * a particular namespace URI, in one operation. To use an instance of a
026 * class that imlements this interface:</p>
027 * <ul>
028 * <li>Create a concrete implementation of this interface.</li>
029 * <li>Optionally, you can configure a <code>RuleSet</code> to be relevant
030 * only for a particular namespace URI by configuring the value to be
031 * returned by <code>getNamespaceURI()</code>.</li>
032 * <li>As you are configuring your Digester instance, call
033 * <code>digester.addRuleSet()</code> and pass the RuleSet instance.</li>
034 * <li>Digester will call the <code>addRuleInstances()</code> method of
035 * your RuleSet to configure the necessary rules.</li>
036 * </ul>
037 */
038
039 public interface RuleSet {
040
041
042 // ------------------------------------------------------------- Properties
043
044
045 /**
046 * Return the namespace URI that will be applied to all Rule instances
047 * created from this RuleSet.
048 */
049 public String getNamespaceURI();
050
051
052 // --------------------------------------------------------- Public Methods
053
054
055 /**
056 * Add the set of Rule instances defined in this RuleSet to the
057 * specified <code>Digester</code> instance, associating them with
058 * our namespace URI (if any). This method should only be called
059 * by a Digester instance.
060 *
061 * @param digester Digester instance to which the new Rule instances
062 * should be added.
063 */
064 public void addRuleInstances(Digester digester);
065
066
067 }