1 18 19 20 package org.apache.struts.webapp.validator; 21 22 import java.io.Serializable ; 23 import java.util.ArrayList ; 24 import java.util.List ; 25 import javax.servlet.http.HttpServletRequest ; 26 import org.apache.struts.action.ActionMapping; 27 import org.apache.struts.util.LabelValueBean; 28 import org.apache.struts.validator.ValidatorForm; 29 30 31 35 public final class TypeForm extends ValidatorForm implements Serializable { 36 private String action = null; 37 private String name = null; private String sByte = null; 39 private String sShort = null; 40 private String sInteger = null; 41 private String sLong = null; 42 private String sFloat = null; 43 private String sFloatRange = null; 44 private String sDouble = null; 45 private String sDate = null; 46 private String sCreditCard = null; 47 private String sSatisfaction = null; 48 private String [] sOsList = null; 49 private String sOverallSatisfaction = null; 50 private String sWouldRecommend = null; 51 private String [] sUsedLanguages = null; 52 53 private List lNames = initNames(); 54 55 public String getAction() { 56 return action; 57 } 58 59 public void setAction(String action) { 60 this.action = action; 61 } 62 63 public String getName() { 64 return name; 65 } 66 67 public void setName(String name) { 68 this.name = name; 69 } 70 71 public String getByte() { 72 return sByte; 73 } 74 75 public void setByte(String sByte) { 76 this.sByte = sByte; 77 } 78 79 public String getShort() { 80 return sShort; 81 } 82 83 public void setShort(String sShort) { 84 this.sShort = sShort; 85 } 86 87 public String getInteger() { 88 return sInteger; 89 } 90 91 public void setInteger(String sInteger) { 92 this.sInteger = sInteger; 93 } 94 95 public String getLong() { 96 return sLong; 97 } 98 99 public void setLong(String sLong) { 100 this.sLong = sLong; 101 } 102 103 public String getFloat() { 104 return sFloat; 105 } 106 107 public void setFloat(String sFloat) { 108 this.sFloat = sFloat; 109 } 110 111 115 public String getFloatRange() { 116 return sFloatRange; 117 } 118 119 123 public void setFloatRange(String sFloatRange) { 124 this.sFloatRange = sFloatRange; 125 } 126 127 public String getDouble() { 128 return sDouble; 129 } 130 131 public void setDouble(String sDouble) { 132 this.sDouble = sDouble; 133 } 134 135 public String getDate() { 136 return sDate; 137 } 138 139 public void setDate(String sDate) { 140 this.sDate = sDate; 141 } 142 143 public String getCreditCard() { 144 return sCreditCard; 145 } 146 147 public void setCreditCard(String sCreditCard) { 148 this.sCreditCard = sCreditCard; 149 } 150 151 public String getSatisfaction() { 152 return sSatisfaction; 153 } 154 155 public void setSatisfaction(String sSatisfaction) { 156 this.sSatisfaction = sSatisfaction; 157 } 158 159 public String [] getOsList() { 160 return sOsList; 161 } 162 163 public void setOsList(String [] anOsList) { 164 this.sOsList = anOsList; 165 } 166 167 public String getOverallSatisfaction() { 168 return sOverallSatisfaction; 169 } 170 171 public void setOverallSatisfaction(String anOverallSatisfaction) { 172 this.sOverallSatisfaction = anOverallSatisfaction; 173 } 174 175 public String getWouldRecommend() { 176 return sWouldRecommend; 177 } 178 179 public void setWouldRecommend(String anWouldRecommend) { 180 this.sWouldRecommend = anWouldRecommend; 181 } 182 183 public String [] getUsedLanguages() { 184 return sUsedLanguages; 185 } 186 187 public void setUsedLanguages(String [] anUsedLanguages) { 188 this.sUsedLanguages = anUsedLanguages; 189 } 190 191 public List getNameList() { 192 return lNames; 193 } 194 195 public void setNameList(List lNames) { 196 this.lNames = lNames; 197 } 198 199 205 public void reset(ActionMapping mapping, HttpServletRequest request) { 206 String reset = (String )request.getAttribute("typeForm.reset"); 207 if ((null != reset)|| ("true".equals(reset))) { 208 action = null; 209 sByte = null; 210 sShort = null; 211 sInteger = null; 212 sLong = null; 213 sFloat = null; 214 sFloatRange = null; 215 sDouble = null; 216 sDate = null; 217 sCreditCard = null; 218 sSatisfaction = null; 219 sOsList = null; 220 sOverallSatisfaction = null; 221 sUsedLanguages = null; 222 } 223 } 225 226 230 private static List initNames() { 231 List lResults = new ArrayList (); 232 233 for (int i = 0; i < 3; i++) { 234 lResults.add(new LabelValueBean(null, null)); 235 } 236 237 return lResults; 238 } 239 } 240 | Popular Tags |