01: /*
02: * JFox - The most lightweight Java EE Application Server!
03: * more details please visit http://www.huihoo.org/jfox or http://www.jfox.org.cn.
04: *
05: * JFox is licenced and re-distributable under GNU LGPL.
06: */
07: package org.jfox.mvc.validate;
08:
09: import org.jfox.framework.BaseException;
10:
11: /**
12: * @author <a href="mailto:jfox.young@gmail.com">Young Yang</a>
13: */
14: public class ValidateException extends BaseException {
15:
16: // 输入框å??称
17: private String inputField;
18: private Object inputValue;
19:
20: public ValidateException(String message, Object inputValue) {
21: super (message);
22: this .inputValue = inputValue;
23: }
24:
25: public ValidateException(String message, String inputFieldName,
26: Object inputValue) {
27: super (message);
28: this .inputValue = inputValue;
29: this .inputField = inputFieldName;
30: }
31:
32: public void setInputField(String inputField) {
33: this .inputField = inputField;
34: }
35:
36: public String getInputField() {
37: return inputField;
38: }
39:
40: public Object getInputValue() {
41: return inputValue;
42: }
43:
44: public String getMessage() {
45: String message = super .getMessage();
46: String inputInfo = " [name:" + getInputField() + ", value: "
47: + getInputValue() + "]";
48: message += inputInfo;
49: return message;
50: }
51:
52: public static void main(String[] args) {
53:
54: }
55: }
|