1 17 18 19 package org.apache.commons.digester; 20 21 22 import org.xml.sax.Attributes ; 23 24 32 33 public class PathCallParamRule extends Rule { 34 35 37 43 public PathCallParamRule(int paramIndex) { 44 45 this.paramIndex = paramIndex; 46 47 } 48 49 51 54 protected int paramIndex = 0; 55 56 58 59 70 public void begin(String namespace, String name, Attributes attributes) throws Exception { 71 72 String param = getDigester().getMatch(); 73 74 if(param != null) { 75 Object parameters[] = (Object []) digester.peekParams(); 76 parameters[paramIndex] = param; 77 } 78 79 } 80 81 84 public String toString() { 85 86 StringBuffer sb = new StringBuffer ("PathCallParamRule["); 87 sb.append("paramIndex="); 88 sb.append(paramIndex); 89 sb.append("]"); 90 return (sb.toString()); 91 92 } 93 } 94 | Popular Tags |