1 17 18 19 package org.apache.commons.digester; 20 21 22 import java.util.List ; 23 24 import org.xml.sax.Attributes ; 25 26 27 35 36 public class TestRule extends Rule { 37 38 40 41 42 private String identifier; 43 44 45 private String bodyText; 46 47 48 private List order; 49 50 52 57 public TestRule(String identifier) { 58 59 this.identifier = identifier; 60 } 61 62 69 public TestRule( 70 String identifier, 71 String namespaceURI) { 72 73 this.identifier = identifier; 74 setNamespaceURI(namespaceURI); 75 76 } 77 78 79 81 82 85 public void begin(Attributes attributes) { 86 appendCall(); 87 } 88 89 90 93 public void body(String text) { 94 this.bodyText = text; 95 appendCall(); 96 } 97 98 99 102 public void end() { 103 appendCall(); 104 } 105 106 107 109 110 113 protected void appendCall() { 114 if (order != null) 115 order.add(this); 116 } 117 118 119 122 public String getBodyText() { 123 return bodyText; 124 } 125 126 127 130 public String getIdentifier() { 131 return identifier; 132 } 133 134 135 138 public List getOrder() { 139 return order; 140 } 141 142 143 146 public void setOrder(List order) { 147 this.order = order; 148 } 149 150 151 154 public String toString() { 155 return identifier; 156 } 157 158 159 } 160 | Popular Tags |