1. /* $Id: RuleLoader.java,v 1.5 2004/05/10 06:36:38 skitching Exp $
  2. *
  3. * Copyright 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.plugins;
  18. import org.apache.commons.digester.Digester;
  19. /**
  20. * Interface for classes which can dynamically load custom
  21. * plugin rules associated with a user's plugin class.
  22. * <p>
  23. * Each plugin declaration has an associated RuleLoader instance, and that
  24. * instance's addRules method is invoked each time the input xml specifies
  25. * that an instance of that plugged-in class is to be created.
  26. * <p>
  27. * This is an abstract class rather than an interface in order to make
  28. * it possible to enhance this class in future without breaking binary
  29. * compatibility; it is possible to add methods to an abstract class, but
  30. * not to an interface.
  31. *
  32. * @since 1.6
  33. */
  34. public abstract class RuleLoader {
  35. /**
  36. * Configures the digester with custom rules for some plugged-in
  37. * class.
  38. * <p>
  39. * This method is invoked when the start of an xml tag is encountered
  40. * which maps to a PluginCreateRule. Any rules added here are removed
  41. * from the digester when the end of that xml tag is encountered.
  42. */
  43. public abstract void addRules(Digester d, String path) throws PluginException;
  44. }