1 17 18 package org.apache.commons.digester.plugins.strategies; 19 20 import java.util.Properties ; 21 22 import org.apache.commons.digester.Digester; 23 import org.apache.commons.digester.plugins.RuleFinder; 24 import org.apache.commons.digester.plugins.RuleLoader; 25 26 43 44 public class FinderSetProperties extends RuleFinder { 45 public static String DFLT_PROPS_ATTR = "setprops"; 46 public static String DFLT_FALSEVAL = "false"; 47 48 private String propsAttr; 49 private String falseval; 50 51 52 public FinderSetProperties() { 53 this(DFLT_PROPS_ATTR, DFLT_FALSEVAL); 54 } 55 56 67 public FinderSetProperties(String propsAttr, String falseval) { 68 this.propsAttr = propsAttr; 69 this.falseval = falseval; 70 } 71 72 86 public RuleLoader findLoader(Digester d, Class pluginClass, Properties p) { 87 String state = p.getProperty(propsAttr); 88 if ((state != null) && state.equals(falseval)) { 89 return null; 92 } 93 94 return new LoaderSetProperties(); 95 } 96 } 97 98 | Popular Tags |