1 16 package org.apache.commons.chain.config; 17 18 19 import org.apache.commons.digester.Rule; 20 import org.xml.sax.Attributes ; 21 22 23 33 34 class ConfigDefineRule extends Rule { 35 36 37 39 40 49 public ConfigDefineRule(String nameAttribute, String classAttribute) { 50 super(); 51 this.nameAttribute = nameAttribute; 52 this.classAttribute = classAttribute; 53 } 54 55 56 58 59 64 private String classAttribute = null; 65 66 67 71 private String nameAttribute = null; 72 73 74 76 77 87 public void begin(String namespace, String name, Attributes attributes) 88 throws Exception { 89 90 String nameValue = attributes.getValue(nameAttribute); 92 String classValue = attributes.getValue(classAttribute); 93 94 digester.addObjectCreate("*/" + nameValue, classValue); 96 digester.addSetProperties("*/" + nameValue); 97 digester.addRule("*/" + nameValue, 98 new ConfigRegisterRule(nameAttribute)); 99 100 } 101 102 103 } 104 | Popular Tags |