01: /* $Id: RuleLoader.java 471661 2006-11-06 08:09:25Z skitching $
02: *
03: * Licensed to the Apache Software Foundation (ASF) under one or more
04: * contributor license agreements. See the NOTICE file distributed with
05: * this work for additional information regarding copyright ownership.
06: * The ASF licenses this file to You under the Apache License, Version 2.0
07: * (the "License"); you may not use this file except in compliance with
08: * the License. You may obtain a copy of the License at
09: *
10: * http://www.apache.org/licenses/LICENSE-2.0
11: *
12: * Unless required by applicable law or agreed to in writing, software
13: * distributed under the License is distributed on an "AS IS" BASIS,
14: * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15: * See the License for the specific language governing permissions and
16: * limitations under the License.
17: */
18:
19: package org.apache.commons.digester.plugins;
20:
21: import org.apache.commons.digester.Digester;
22:
23: /**
24: * Interface for classes which can dynamically load custom
25: * plugin rules associated with a user's plugin class.
26: * <p>
27: * Each plugin declaration has an associated RuleLoader instance, and that
28: * instance's addRules method is invoked each time the input xml specifies
29: * that an instance of that plugged-in class is to be created.
30: * <p>
31: * This is an abstract class rather than an interface in order to make
32: * it possible to enhance this class in future without breaking binary
33: * compatibility; it is possible to add methods to an abstract class, but
34: * not to an interface.
35: *
36: * @since 1.6
37: */
38:
39: public abstract class RuleLoader {
40:
41: /**
42: * Configures the digester with custom rules for some plugged-in
43: * class.
44: * <p>
45: * This method is invoked when the start of an xml tag is encountered
46: * which maps to a PluginCreateRule. Any rules added here are removed
47: * from the digester when the end of that xml tag is encountered.
48: */
49: public abstract void addRules(Digester d, String path)
50: throws PluginException;
51: }
|