1 17 package org.apache.commons.digester.plugins; 18 19 import java.util.List ; 20 import java.util.LinkedList ; 21 22 import org.apache.commons.digester.plugins.strategies.FinderFromFile; 23 import org.apache.commons.digester.plugins.strategies.FinderFromResource; 24 import org.apache.commons.digester.plugins.strategies.FinderFromClass; 25 import org.apache.commons.digester.plugins.strategies.FinderFromMethod; 26 import org.apache.commons.digester.plugins.strategies.FinderFromDfltMethod; 27 import org.apache.commons.digester.plugins.strategies.FinderFromDfltClass; 28 import org.apache.commons.digester.plugins.strategies.FinderFromDfltResource; 29 import org.apache.commons.digester.plugins.strategies.FinderSetProperties; 30 31 47 48 public class PluginContext { 49 50 public final String DFLT_PLUGIN_CLASS_ATTR_NS = null; 53 public final String DFLT_PLUGIN_CLASS_ATTR = "plugin-class"; 54 55 public final String DFLT_PLUGIN_ID_ATTR_NS = null; 58 public final String DFLT_PLUGIN_ID_ATTR = "plugin-id"; 59 60 61 private String pluginClassAttrNs = DFLT_PLUGIN_CLASS_ATTR_NS; 62 63 64 private String pluginClassAttr = DFLT_PLUGIN_CLASS_ATTR; 65 66 67 private String pluginIdAttrNs = DFLT_PLUGIN_ID_ATTR_NS; 68 69 70 private String pluginIdAttr = DFLT_PLUGIN_ID_ATTR; 71 72 77 private List ruleFinders; 78 79 81 public PluginContext() { 82 } 83 84 86 95 public List getRuleFinders() { 96 if (ruleFinders == null) { 97 ruleFinders = new LinkedList (); 101 ruleFinders.add(new FinderFromFile()); 102 ruleFinders.add(new FinderFromResource()); 103 ruleFinders.add(new FinderFromClass()); 104 ruleFinders.add(new FinderFromMethod()); 105 ruleFinders.add(new FinderFromDfltMethod()); 106 ruleFinders.add(new FinderFromDfltClass()); 107 ruleFinders.add(new FinderFromDfltResource()); 108 ruleFinders.add(new FinderFromDfltResource(".xml")); 109 ruleFinders.add(new FinderSetProperties()); 110 } 111 return ruleFinders; 112 } 113 114 124 public void setRuleFinders(List ruleFinders) { 125 this.ruleFinders = ruleFinders; 126 } 127 128 161 public void setPluginClassAttribute(String namespaceUri, 162 String attrName) { 163 pluginClassAttrNs = namespaceUri; 164 pluginClassAttr = attrName; 165 } 166 167 200 public void setPluginIdAttribute(String namespaceUri, 201 String attrName) { 202 pluginIdAttrNs = namespaceUri; 203 pluginIdAttr = attrName; 204 } 205 206 212 public String getPluginClassAttrNs() { 213 return pluginClassAttrNs; 214 } 215 216 222 public String getPluginClassAttr() { 223 return pluginClassAttr; 224 } 225 226 232 public String getPluginIdAttrNs() { 233 return pluginIdAttrNs; 234 } 235 236 242 public String getPluginIdAttr() { 243 return pluginIdAttr; 244 } 245 } 246 | Popular Tags |