org.apache.commons.digester.plugins.strategies
Class LoaderFromClass
java.lang.Object
|
+--org.apache.commons.digester.plugins.RuleLoader
|
+--org.apache.commons.digester.plugins.strategies.LoaderFromClass
- public class LoaderFromClass
- extends RuleLoader
A RuleLoader which invokes a static method on a target class, leaving that
method to actually instantiate and add new rules to a Digester instance.
- Since:
- 1.6
Constructor Summary |
LoaderFromClass(java.lang.Class rulesClass,
java.lang.reflect.Method rulesMethod)
Constructor. |
LoaderFromClass(java.lang.Class rulesClass,
java.lang.String methodName)
Constructor. |
Method Summary |
void |
addRules(Digester d,
java.lang.String path)
Just invoke the target method. |
static java.lang.reflect.Method |
locateMethod(java.lang.Class rulesClass,
java.lang.String methodName)
Find a method on the specified class whose name matches methodName,
and whose signature is:
public static void foo(Digester d, String patternPrefix); . |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
LoaderFromClass
public LoaderFromClass(java.lang.Class rulesClass,
java.lang.reflect.Method rulesMethod)
- Constructor.
LoaderFromClass
public LoaderFromClass(java.lang.Class rulesClass,
java.lang.String methodName)
throws PluginException
- Constructor.
addRules
public void addRules(Digester d,
java.lang.String path)
throws PluginException
- Just invoke the target method.
- Overrides:
addRules
in class RuleLoader
locateMethod
public static java.lang.reflect.Method locateMethod(java.lang.Class rulesClass,
java.lang.String methodName)
throws PluginException
- Find a method on the specified class whose name matches methodName,
and whose signature is:
public static void foo(Digester d, String patternPrefix);
.
- Returns:
- null if no such method exists.
Copyright © 2001-2006 The Apache Software Foundation. All Rights Reserved.