1 16 package org.apache.commons.chain.config; 17 18 19 import org.apache.commons.digester.Digester; 20 import org.apache.commons.digester.RuleSetBase; 21 22 23 72 73 public class ConfigRuleSet extends RuleSetBase { 74 75 76 78 79 private String catalogClass = "org.apache.commons.chain.impl.CatalogBase"; 80 private String catalogElement = "catalog"; 81 private String chainClass = "org.apache.commons.chain.impl.ChainBase"; 82 private String chainElement = "chain"; 83 private String classAttribute = "className"; 84 private String commandElement = "command"; 85 private String defineElement = "define"; 86 private String nameAttribute = "name"; 87 88 89 91 92 95 public String getCatalogClass() { 96 return (this.catalogClass); 97 } 98 99 100 105 public void setCatalogClass(String catalogClass) { 106 this.catalogClass = catalogClass; 107 } 108 109 110 113 public String getCatalogElement() { 114 return (this.catalogElement); 115 } 116 117 118 123 public void setCatalogElement(String catalogElement) { 124 this.catalogElement = catalogElement; 125 } 126 127 128 131 public String getChainClass() { 132 return (this.chainClass); 133 } 134 135 136 141 public void setChainClass(String chainClass) { 142 this.chainClass = chainClass; 143 } 144 145 146 149 public String getChainElement() { 150 return (this.chainElement); 151 } 152 153 154 159 public void setChainElement(String chainElement) { 160 this.chainElement = chainElement; 161 } 162 163 164 167 public String getClassAttribute() { 168 return (this.classAttribute); 169 } 170 171 172 177 public void setClassAttribute(String classAttribute) { 178 this.classAttribute = classAttribute; 179 } 180 181 182 185 public String getCommandElement() { 186 return (this.commandElement); 187 } 188 189 190 195 public void setCommandElement(String commandElement) { 196 this.commandElement = commandElement; 197 } 198 199 200 203 public String getDefineElement() { 204 return (this.defineElement); 205 } 206 207 208 213 public void setDefineElement(String defineElement) { 214 this.defineElement = defineElement; 215 } 216 217 218 221 public String getNameAttribute() { 222 return (this.nameAttribute); 223 } 224 225 226 231 public void setNameAttribute(String nameAttribute) { 232 this.nameAttribute = nameAttribute; 233 } 234 235 236 238 239 248 public void addRuleInstances(Digester digester) { 249 250 digester.addRule("*/" + getCatalogElement(), 252 new ConfigCatalogRule(nameAttribute, catalogClass)); 253 digester.addSetProperties("*/" + getCatalogElement()); 254 255 digester.addObjectCreate("*/" + getChainElement(), 257 getChainClass(), 258 getClassAttribute()); 259 digester.addSetProperties("*/" + getChainElement()); 260 digester.addRule("*/" + getChainElement(), 261 new ConfigRegisterRule(nameAttribute)); 262 263 digester.addObjectCreate("*/" + getCommandElement(), 265 null, 266 getClassAttribute()); 267 digester.addSetProperties("*/" + getCommandElement()); 268 digester.addRule("*/" + getCommandElement(), 269 new ConfigRegisterRule(nameAttribute)); 270 271 digester.addRule("*/" + getDefineElement(), 273 new ConfigDefineRule(getNameAttribute(), 274 getClassAttribute())); 275 276 } 277 278 279 } 280 | Popular Tags |