1 18 19 20 package org.apache.struts.config; 21 22 23 import java.io.Serializable ; 24 25 26 34 35 public class ExceptionConfig implements Serializable { 36 37 38 40 41 44 protected boolean configured = false; 45 46 47 49 50 55 protected String bundle = null; 56 57 public String getBundle() { 58 return (this.bundle); 59 } 60 61 public void setBundle(String bundle) { 62 if (configured) { 63 throw new IllegalStateException ("Configuration is frozen"); 64 } 65 this.bundle = bundle; 66 } 67 68 69 73 protected String handler = "org.apache.struts.action.ExceptionHandler"; 74 75 public String getHandler() { 76 return (this.handler); 77 } 78 79 public void setHandler(String handler) { 80 if (configured) { 81 throw new IllegalStateException ("Configuration is frozen"); 82 } 83 this.handler = handler; 84 } 85 86 87 91 protected String key = null; 92 93 public String getKey() { 94 return (this.key); 95 } 96 97 public void setKey(String key) { 98 if (configured) { 99 throw new IllegalStateException ("Configuration is frozen"); 100 } 101 this.key = key; 102 } 103 104 105 109 protected String path = null; 110 111 public String getPath() { 112 return (this.path); 113 } 114 115 public void setPath(String path) { 116 if (configured) { 117 throw new IllegalStateException ("Configuration is frozen"); 118 } 119 this.path = path; 120 } 121 122 123 127 protected String scope = "request"; 128 129 public String getScope() { 130 return (this.scope); 131 } 132 133 public void setScope(String scope) { 134 if (configured) { 135 throw new IllegalStateException ("Configuration is frozen"); 136 } 137 this.scope = scope; 138 } 139 140 141 145 protected String type = null; 146 147 public String getType() { 148 return (this.type); 149 } 150 151 public void setType(String type) { 152 if (configured) { 153 throw new IllegalStateException ("Configuration is frozen"); 154 } 155 this.type = type; 156 } 157 158 159 161 162 165 public void freeze() { 166 167 configured = true; 168 169 } 170 171 172 175 public String toString() { 176 177 StringBuffer sb = new StringBuffer ("ExceptionConfig["); 178 sb.append("type="); 179 sb.append(this.type); 180 if (this.bundle != null) { 181 sb.append(",bundle="); 182 sb.append(this.bundle); 183 } 184 sb.append(",key="); 185 sb.append(this.key); 186 sb.append(",path="); 187 sb.append(this.path); 188 sb.append(",scope="); 189 sb.append(this.scope); 190 sb.append("]"); 191 return (sb.toString()); 192 193 } 194 195 196 } 197 | Popular Tags |