KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > enhydra > tool > codegen > ValidationException


1
2 /*
3  * Enhydra Java Application Server Project
4  *
5  * The contents of this file are subject to the Enhydra Public License
6  * Version 1.1 (the "License"); you may not use this file except in
7  * compliance with the License. You may obtain a copy of the License on
8  * the Enhydra web site ( http://www.enhydra.org/ ).
9  *
10  * Software distributed under the License is distributed on an "AS IS"
11  * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
12  * the License for the specific terms governing rights and limitations
13  * under the License.
14  *
15  * The Initial Developer of the Enhydra Application Server is Lutris
16  * Technologies, Inc. The Enhydra Application Server and portions created
17  * by Lutris Technologies, Inc. are Copyright Lutris Technologies, Inc.
18  * All Rights Reserved.
19  *
20  * Contributor(s):
21  *
22  */

23 package org.enhydra.tool.codegen;
24
25 /**
26  * The ValidationException can be thrown when validating option values.
27  */

28 public class ValidationException extends GeneratorException {
29     transient private String JavaDoc validationMsg = new String JavaDoc();
30
31     /**
32      * Create a GeneratorException with a specified error message.
33      *
34      * @param message
35      * Message providing information on the nature of the exception.
36      */

37     public ValidationException(String JavaDoc message) {
38         super(message);
39         validationMsg = message;
40     }
41
42     /**
43      * Create a ValidationException linked to a parent exception.
44      *
45      * @param chain
46      * Parent exception to include in stack trace.
47      * @param message
48      * Message providing information on the nature of the exception.
49      */

50     public ValidationException(Throwable JavaDoc chain, String JavaDoc message) {
51         super(chain, message);
52         validationMsg = message;
53     }
54
55     /**
56      * Get the message of this exception without any other chain
57      * member messages.
58      *
59      * @return
60      * A single exception message.
61      */

62     public String JavaDoc getValidationMessage() {
63         return validationMsg;
64     }
65
66 }
67
Popular Tags