1. /* $Id: RuleSetBase.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>Convenience base class that implements the {@link RuleSet} interface.
  20. * Concrete implementations should list all of their actual rule creation
  21. * logic in the <code>addRuleSet()</code> implementation.</p>
  22. */
  23. public abstract class RuleSetBase implements RuleSet {
  24. // ----------------------------------------------------- Instance Variables
  25. /**
  26. * The namespace URI that all Rule instances created by this RuleSet
  27. * will be associated with.
  28. */
  29. protected String namespaceURI = null;
  30. // ------------------------------------------------------------- Properties
  31. /**
  32. * Return the namespace URI that will be applied to all Rule instances
  33. * created from this RuleSet.
  34. */
  35. public String getNamespaceURI() {
  36. return (this.namespaceURI);
  37. }
  38. // --------------------------------------------------------- Public Methods
  39. /**
  40. * Add the set of Rule instances defined in this RuleSet to the
  41. * specified <code>Digester</code> instance, associating them with
  42. * our namespace URI (if any). This method should only be called
  43. * by a Digester instance.
  44. *
  45. * @param digester Digester instance to which the new Rule instances
  46. * should be added.
  47. */
  48. public abstract void addRuleInstances(Digester digester);
  49. }