KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > net > sf > uitags > util > IllegalPropertyValueException


1 /**
2  * Nov 22, 2004
3  *
4  * Copyright 2004 uitags
5  *
6  * Licensed under the Apache License, Version 2.0 (the "License");
7  * you may not use this file except in compliance with the License.
8  * You may obtain a copy of the License at
9  *
10  * http://www.apache.org/licenses/LICENSE-2.0
11  *
12  * Unless required by applicable law or agreed to in writing, software
13  * distributed under the License is distributed on an "AS IS" BASIS,
14  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15  * See the License for the specific language governing permissions and
16  * limitations under the License.
17  */

18 package net.sf.uitags.util;
19
20
21 /**
22  * Thrown when an illegal property value is encountered.
23  *
24  * @author jonni
25  * @version $Id$
26  */

27 public final class IllegalPropertyValueException extends RuntimeException JavaDoc {
28   /**
29    * Serial Version UID.
30    */

31   private static final long serialVersionUID = 52L;
32
33   ////////////////////////////
34
////////// Fields //////////
35
////////////////////////////
36

37   /**
38    * The name of the property whose value is illegal
39    */

40   private String JavaDoc propKey;
41   /**
42    * The offending value
43    */

44   private String JavaDoc propValue;
45   /**
46    * The reason the property is illegal
47    */

48   private String JavaDoc reason;
49
50
51
52   //////////////////////////////////
53
////////// Constructors //////////
54
//////////////////////////////////
55

56   /**
57    * See {@link RuntimeException#RuntimeException()}.
58    */

59   public IllegalPropertyValueException() {
60     super();
61   }
62
63   /**
64    * See {@link RuntimeException#RuntimeException(java.lang.String)}.
65    *
66    * @param message the detail message
67    */

68   public IllegalPropertyValueException(String JavaDoc message) {
69     super(message);
70   }
71
72   /**
73    * See {@link RuntimeException#RuntimeException(java.lang.Throwable)}.
74    *
75    * @param cause the cause
76    */

77   public IllegalPropertyValueException(Throwable JavaDoc cause) {
78     super(cause);
79   }
80
81   /**
82    * See
83    * {@link RuntimeException#RuntimeException(java.lang.String, java.lang.Throwable)}.
84    *
85    * @param message the detail message
86    * @param cause the cause
87    */

88   public IllegalPropertyValueException(String JavaDoc message, Throwable JavaDoc cause) {
89     super(message, cause);
90   }
91
92   /**
93    * Creates an instance, setting the name and value of the offending
94    * property, and a message explaining why it's illegal.
95    *
96    * @param propKey the name of the property whose value is illegal
97    * @param propValue the offending value
98    * @param reason the reason the property is illegal
99    */

100   public IllegalPropertyValueException(
101       String JavaDoc propKey, String JavaDoc propValue, String JavaDoc reason) {
102     super("Illegal value for property '" + propKey + "': '" + propValue + "'.");
103     this.propKey = propKey;
104     this.propValue = propValue;
105     this.reason = reason;
106   }
107
108
109
110   /////////////////////////////
111
////////// Methods //////////
112
/////////////////////////////
113

114   /**
115    * Returns the name of the property whose value is illegal.
116    *
117    * @return the name of the property whose value is illegal
118    */

119   public String JavaDoc getPropertyKey() {
120     return this.propKey;
121   }
122
123   /**
124    * Returns the offending value.
125    *
126    * @return the offending value
127    */

128   public String JavaDoc getPropertyValue() {
129     return this.propValue;
130   }
131
132   /**
133    * Returns the reason why the property value is illegal.
134    *
135    * @return the reason why the property value is illegal
136    */

137   public String JavaDoc getReason() {
138     return this.reason;
139   }
140 }
141
Popular Tags