1 17 18 package org.apache.commons.digester.plugins.strategies; 19 20 import java.util.Properties ; 21 import org.apache.commons.digester.Digester; 22 import org.apache.commons.digester.plugins.RuleFinder; 23 import org.apache.commons.digester.plugins.RuleLoader; 24 import org.apache.commons.digester.plugins.PluginException; 25 26 32 33 public class FinderFromMethod extends RuleFinder { 34 38 public static String DFLT_METHOD_ATTR = "method"; 39 40 41 private String methodAttr; 42 43 44 public FinderFromMethod() { 45 this(DFLT_METHOD_ATTR); 46 } 47 48 49 public FinderFromMethod(String methodAttr) { 50 this.methodAttr = methodAttr; 51 } 52 53 65 public RuleLoader findLoader(Digester d, Class pluginClass, Properties p) 66 throws PluginException { 67 68 String methodName = p.getProperty(methodAttr); 69 if (methodName == null) { 70 return null; 73 } 74 75 return new LoaderFromClass(pluginClass, methodName); 76 } 77 } 78 79 | Popular Tags |