1 18 package org.apache.struts.util; 19 20 import org.apache.struts.action.ActionError; 21 import org.apache.struts.action.ActionMessage; 22 23 26 public class ModuleException extends Exception { 27 28 protected String property = null; 29 30 33 protected ActionError error = null; 34 35 39 protected ActionMessage message = null; 40 41 46 public ModuleException(String key) { 47 super(key); 48 error = new ActionError(key); 49 message = new ActionMessage(key); 50 } 51 52 58 public ModuleException(String key, Object value) { 59 super(key); 60 error = new ActionError(key, value); 61 message = new ActionMessage(key, value); 62 } 63 64 71 public ModuleException(String key, Object value0, Object value1) { 72 super(key); 73 error = new ActionError(key, value0, value1); 74 message = new ActionMessage(key, value0, value1); 75 } 76 77 85 public ModuleException(String key, Object value0, Object value1, Object value2) { 86 super(key); 87 error = new ActionError(key, value0, value1, value2); 88 message = new ActionMessage(key, value0, value1, value2); 89 } 90 91 100 public ModuleException(String key, Object value0, Object value1, Object value2, Object value3) { 101 super(key); 102 error = new ActionError(key, value0, value1, value2, value3); 103 message = new ActionMessage(key, value0, value1, value2, value3); 104 } 105 106 112 public ModuleException(String key, Object [] values) { 113 super(key); 114 error = new ActionError(key, values); 115 message = new ActionMessage(key, values); 116 } 117 118 122 public String getProperty() { 123 return (property != null) ? property : message.getKey(); 124 } 125 126 130 public void setProperty(String property) { 131 this.property = property; 132 } 133 134 140 public ActionError getError() { 141 return error; 142 } 143 144 149 public ActionMessage getActionMessage() { 150 return this.message; 151 } 152 } 153 | Popular Tags |