01: /**
02: * Licensed to the Apache Software Foundation (ASF) under one or more
03: * contributor license agreements. See the NOTICE file distributed with
04: * this work for additional information regarding copyright ownership.
05: * The ASF licenses this file to You under the Apache License, Version 2.0
06: * (the "License"); you may not use this file except in compliance with
07: * the License. You may obtain a copy of the License at
08: *
09: * http://www.apache.org/licenses/LICENSE-2.0
10: *
11: * Unless required by applicable law or agreed to in writing, software
12: * distributed under the License is distributed on an "AS IS" BASIS,
13: * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14: * See the License for the specific language governing permissions and
15: * limitations under the License.
16: */package org.apache.geronimo.validator;
17:
18: public class ValidationException extends java.lang.Exception {
19:
20: protected static Messages messages = new Messages("");
21:
22: protected Object[] details;
23: protected String message;
24:
25: protected String prefix;
26:
27: public ValidationException(String message) {
28: this .message = message;
29: }
30:
31: public void setDetails(Object arg1) {
32: this .details = new Object[] { arg1 };
33: }
34:
35: public void setDetails(Object arg1, Object arg2) {
36: this .details = new Object[] { arg1, arg2 };
37: }
38:
39: public void setDetails(Object arg1, Object arg2, Object arg3) {
40: this .details = new Object[] { arg1, arg2, arg3 };
41: }
42:
43: public void setDetails(Object arg1, Object arg2, Object arg3,
44: Object arg4) {
45: this .details = new Object[] { arg1, arg2, arg3, arg4 };
46: }
47:
48: public void setDetails(Object arg1, Object arg2, Object arg3,
49: Object arg4, Object arg5) {
50: this .details = new Object[] { arg1, arg2, arg3, arg4, arg5 };
51: }
52:
53: public void setDetails(Object arg1, Object arg2, Object arg3,
54: Object arg4, Object arg5, Object arg6) {
55: this .details = new Object[] { arg1, arg2, arg3, arg4, arg5,
56: arg6 };
57: }
58:
59: public Object[] getDetails() {
60: return details;
61: }
62:
63: public String getSummary() {
64: return getMessage(1);
65: }
66:
67: public String getMessage() {
68: return getMessage(2);
69: }
70:
71: public String getMessage(int level) {
72: return messages.format(level + "." + message, details);
73: }
74:
75: public String getPrefix() {
76: return "";
77: }
78:
79: public String getCategory() {
80: return "";
81: }
82:
83: }
|