1. /* $Id: RuleSet.java,v 1.9 2004/05/10 06:30:06 skitching Exp $
  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. package org.apache.commons.digester;
  18. /**
  19. * <p>Public interface defining a shorthand means of configuring a complete
  20. * set of related <code>Rule</code> definitions, possibly associated with
  21. * a particular namespace URI, in one operation. To use an instance of a
  22. * class that imlements this interface:</p>
  23. * <ul>
  24. * <li>Create a concrete implementation of this interface.</li>
  25. * <li>Optionally, you can configure a <code>RuleSet</code> to be relevant
  26. * only for a particular namespace URI by configuring the value to be
  27. * returned by <code>getNamespaceURI()</code>.</li>
  28. * <li>As you are configuring your Digester instance, call
  29. * <code>digester.addRuleSet()</code> and pass the RuleSet instance.</li>
  30. * <li>Digester will call the <code>addRuleInstances()</code> method of
  31. * your RuleSet to configure the necessary rules.</li>
  32. * </ul>
  33. */
  34. public interface RuleSet {
  35. // ------------------------------------------------------------- Properties
  36. /**
  37. * Return the namespace URI that will be applied to all Rule instances
  38. * created from this RuleSet.
  39. */
  40. public String getNamespaceURI();
  41. // --------------------------------------------------------- Public Methods
  42. /**
  43. * Add the set of Rule instances defined in this RuleSet to the
  44. * specified <code>Digester</code> instance, associating them with
  45. * our namespace URI (if any). This method should only be called
  46. * by a Digester instance.
  47. *
  48. * @param digester Digester instance to which the new Rule instances
  49. * should be added.
  50. */
  51. public void addRuleInstances(Digester digester);
  52. }