1 18 19 20 package org.apache.struts.config; 21 22 23 import java.io.Serializable ; 24 25 26 34 35 public class ForwardConfig implements Serializable { 36 37 38 40 41 44 public ForwardConfig() { 45 46 super(); 47 48 } 49 50 51 58 public ForwardConfig(String name, String path, boolean redirect) { 59 60 super(); 61 setName(name); 62 setPath(path); 63 setRedirect(redirect); 64 65 } 66 67 68 77 public ForwardConfig(String name, String path, boolean redirect, 78 boolean contextRelative) { 79 80 super(); 81 setName(name); 82 setPath(path); 83 setRedirect(redirect); 84 setContextRelative(contextRelative); 85 86 } 87 88 95 public ForwardConfig(String name, String path, boolean redirect, 96 String module) { 97 98 super(); 99 setName(name); 100 setPath(path); 101 setRedirect(redirect); 102 setModule(module); 103 104 } 105 106 107 109 110 113 protected boolean configured = false; 114 115 116 118 119 125 protected boolean contextRelative = false; 126 127 130 public boolean getContextRelative() { 131 return (this.contextRelative); 132 } 133 134 137 public void setContextRelative(boolean contextRelative) { 138 if (configured) { 139 throw new IllegalStateException ("Configuration is frozen"); 140 } 141 this.contextRelative = contextRelative; 142 } 143 144 145 149 protected String name = null; 150 151 public String getName() { 152 return (this.name); 153 } 154 155 public void setName(String name) { 156 if (configured) { 157 throw new IllegalStateException ("Configuration is frozen"); 158 } 159 this.name = name; 160 } 161 162 163 183 protected String path = null; 184 185 public String getPath() { 186 return (this.path); 187 } 188 189 public void setPath(String path) { 190 if (configured) { 191 throw new IllegalStateException ("Configuration is frozen"); 192 } 193 this.path = path; 194 } 195 196 197 207 protected String module = null; 208 209 public String getModule() { 210 return (this.module); 211 } 212 213 public void setModule(String module) { 214 if (configured) { 215 throw new IllegalStateException ("Configuration is frozen"); 216 } 217 this.module = module; 218 } 219 220 221 224 protected boolean redirect = false; 225 226 public boolean getRedirect() { 227 return (this.redirect); 228 } 229 230 public void setRedirect(boolean redirect) { 231 if (configured) { 232 throw new IllegalStateException ("Configuration is frozen"); 233 } 234 this.redirect = redirect; 235 } 236 237 238 240 241 244 public void freeze() { 245 246 configured = true; 247 248 } 249 250 251 254 public String toString() { 255 256 StringBuffer sb = new StringBuffer ("ForwardConfig["); 257 sb.append("name="); 258 sb.append(this.name); 259 sb.append(",path="); 260 sb.append(this.path); 261 sb.append(",redirect="); 262 sb.append(this.redirect); 263 sb.append(",contextRelative="); 264 sb.append(this.contextRelative); 265 sb.append(",module="); 266 sb.append(this.module); 267 sb.append("]"); 268 return (sb.toString()); 269 270 } 271 272 273 } 274 | Popular Tags |