1 19 20 package com.sslexplorer.core; 21 22 import org.apache.struts.action.ActionMessage; 23 24 39 public class BundleActionMessage extends ActionMessage { 40 41 private static final long serialVersionUID = -3827880344627981596L; 42 43 45 private String bundle; 46 47 53 public BundleActionMessage(String bundle, String key) { 54 super(key); 55 init(bundle); 56 } 57 58 65 public BundleActionMessage(String bundle, String key, Object value0) { 66 super(key, value0); 67 init(bundle); 68 } 69 70 78 public BundleActionMessage(String bundle, String key, Object value0, Object value1) { 79 super(key, value0, value1); 80 init(bundle); 81 } 82 83 92 public BundleActionMessage(String bundle, String key, Object value0, Object value1, Object value2) { 93 super(key, value0, value1, value2); 94 init(bundle); 95 } 96 97 107 public BundleActionMessage(String bundle, String key, Object value0, Object value1, Object value2, Object value3) { 108 super(key, value0, value1, value2, value3); 109 init(bundle); 110 } 111 112 119 public BundleActionMessage(String bundle, String key, Object [] values) { 120 super(key, values); 121 init(bundle); 122 } 123 124 protected void init(String bundle) { 125 this.bundle = bundle; 126 } 127 128 133 public String getArg0() { 134 return values != null && values.length > 0 ? String.valueOf(values[0]) : null; 135 } 136 137 142 public String getArg1() { 143 return values != null && values.length > 1 ? String.valueOf(values[1]) : null; 144 } 145 146 151 public String getArg2() { 152 return values != null && values.length > 2 ? String.valueOf(values[2]) : null; 153 } 154 155 160 public String getArg3() { 161 return values != null && values.length > 3 ? String.valueOf(values[3]) : null; 162 } 163 164 169 public String getBundle() { 170 return bundle; 171 } 172 173 178 public void setBundle(String bundle) { 179 this.bundle = bundle; 180 } 181 182 187 public void setArg0(Object arg0) { 188 if (values == null || values.length == 0) { 189 values = new Object [1]; 190 } 191 values[0] = arg0; 192 } 193 194 199 public void setArg1(Object arg1) { 200 if (values == null || values.length < 2) { 201 values = new Object [] { values == null ? null : values[0], arg1 }; 202 } else { 203 values[1] = arg1; 204 } 205 } 206 207 212 public void setArg2(Object arg2) { 213 if (values == null || values.length < 3) { 214 values = new Object [] { values == null ? null : values[0], values == null ? null : values[1], arg2 }; 215 } else { 216 values[2] = arg2; 217 } 218 } 219 220 225 public void setArg3(Object arg3) { 226 if (values == null || values.length < 4) { 227 values = new Object [] { values == null ? null : values[0], 228 values == null ? null : values[1], 229 values == null ? null : values[2], 230 arg3 }; 231 } else { 232 values[3] = arg3; 233 } 234 } 235 } 236 | Popular Tags |