1 18 19 package org.apache.struts.action; 20 21 import java.io.Serializable ; 22 23 33 public class ActionMessage implements Serializable { 34 35 36 38 39 44 public ActionMessage(String key) { 45 this(key, null); 46 } 47 48 49 55 public ActionMessage(String key, Object value0) { 56 this(key, new Object [] { value0 }); 57 } 58 59 60 67 public ActionMessage(String key, Object value0, Object value1) { 68 this(key, new Object [] { value0, value1 }); 69 } 70 71 72 80 public ActionMessage(String key, Object value0, Object value1, 81 Object value2) { 82 83 this(key, new Object [] { value0, value1, value2 }); 84 } 85 86 87 96 public ActionMessage(String key, Object value0, Object value1, 97 Object value2, Object value3) { 98 99 this(key, new Object [] { value0, value1, value2, value3 }); 100 } 101 102 103 109 public ActionMessage(String key, Object [] values) { 110 111 this.key = key; 112 this.values = values; 113 this.resource = true; 114 115 } 116 117 123 public ActionMessage(String key, boolean resource) { 124 125 this.key = key; 126 this.resource = resource; 127 128 } 129 130 131 133 134 137 protected String key = null; 138 139 140 143 protected Object values[] = null; 144 145 148 protected boolean resource = true; 149 150 151 153 154 157 public String getKey() { 158 159 return (this.key); 160 161 } 162 163 164 167 public Object [] getValues() { 168 169 return (this.values); 170 171 } 172 173 174 177 public boolean isResource() { 178 179 return (this.resource); 180 181 } 182 183 188 public String toString() { 189 StringBuffer buff = new StringBuffer (); 190 buff.append(this.key); 191 buff.append("["); 192 193 if (this.values != null) { 194 195 for (int i = 0; i < this.values.length; i++) { 196 197 buff.append(this.values[i]); 198 199 if (i < this.values.length - 1) { 201 buff.append(", "); 202 } 203 204 } 205 } 206 207 buff.append("]"); 208 209 return buff.toString(); 210 } 211 212 213 } 214 | Popular Tags |