author | chegar |
Wed, 24 Sep 2008 05:35:31 -0700 | |
changeset 1320 | 2412b1562801 |
parent 2 | 90ce3da70b43 |
child 3630 | 28237c1f0c41 |
permissions | -rw-r--r-- |
2 | 1 |
/* |
1320
2412b1562801
6749308: java.io, java.lang, java.util exception classes don't specify serialVersionUID
chegar
parents:
2
diff
changeset
|
2 |
* Copyright 2003-2008 Sun Microsystems, Inc. All Rights Reserved. |
2 | 3 |
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
4 |
* |
|
5 |
* This code is free software; you can redistribute it and/or modify it |
|
6 |
* under the terms of the GNU General Public License version 2 only, as |
|
7 |
* published by the Free Software Foundation. Sun designates this |
|
8 |
* particular file as subject to the "Classpath" exception as provided |
|
9 |
* by Sun in the LICENSE file that accompanied this code. |
|
10 |
* |
|
11 |
* This code is distributed in the hope that it will be useful, but WITHOUT |
|
12 |
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or |
|
13 |
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License |
|
14 |
* version 2 for more details (a copy is included in the LICENSE file that |
|
15 |
* accompanied this code). |
|
16 |
* |
|
17 |
* You should have received a copy of the GNU General Public License version |
|
18 |
* 2 along with this work; if not, write to the Free Software Foundation, |
|
19 |
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. |
|
20 |
* |
|
21 |
* Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, |
|
22 |
* CA 95054 USA or visit www.sun.com if you need additional information or |
|
23 |
* have any questions. |
|
24 |
*/ |
|
25 |
||
26 |
package java.lang.annotation; |
|
27 |
||
28 |
/** |
|
29 |
* Thrown to indicate that a program has attempted to access an element of |
|
30 |
* an annotation type that was added to the annotation type definition after |
|
31 |
* the annotation was compiled (or serialized). This exception will not be |
|
32 |
* thrown if the new element has a default value. |
|
33 |
* |
|
34 |
* @author Josh Bloch |
|
35 |
* @since 1.5 |
|
36 |
*/ |
|
37 |
public class IncompleteAnnotationException extends RuntimeException { |
|
1320
2412b1562801
6749308: java.io, java.lang, java.util exception classes don't specify serialVersionUID
chegar
parents:
2
diff
changeset
|
38 |
private static final long serialVersionUID = 8445097402741811912L; |
2412b1562801
6749308: java.io, java.lang, java.util exception classes don't specify serialVersionUID
chegar
parents:
2
diff
changeset
|
39 |
|
2 | 40 |
private Class annotationType; |
41 |
private String elementName; |
|
42 |
||
43 |
||
44 |
/** |
|
45 |
* Constructs an IncompleteAnnotationException to indicate that |
|
46 |
* the named element was missing from the specified annotation type. |
|
47 |
* |
|
48 |
* @param annotationType the Class object for the annotation type |
|
49 |
* @param elementName the name of the missing element |
|
50 |
*/ |
|
51 |
public IncompleteAnnotationException( |
|
52 |
Class<? extends Annotation> annotationType, |
|
53 |
String elementName) { |
|
54 |
super(annotationType.getName() + " missing element " + elementName); |
|
55 |
||
56 |
this.annotationType = annotationType; |
|
57 |
this.elementName = elementName; |
|
58 |
} |
|
59 |
||
60 |
/** |
|
61 |
* Returns the Class object for the annotation type with the |
|
62 |
* missing element. |
|
63 |
* |
|
64 |
* @return the Class object for the annotation type with the |
|
65 |
* missing element |
|
66 |
*/ |
|
67 |
public Class<? extends Annotation> annotationType() { |
|
68 |
return annotationType; |
|
69 |
} |
|
70 |
||
71 |
/** |
|
72 |
* Returns the name of the missing element. |
|
73 |
* |
|
74 |
* @return the name of the missing element |
|
75 |
*/ |
|
76 |
public String elementName() { |
|
77 |
return elementName; |
|
78 |
} |
|
79 |
} |