KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > javax > lang > model > type > MirroredTypeException


1 /*
2  * @(#)MirroredTypeException.java 1.3 06/07/31
3  *
4  * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
5  * SUN PROPRIETARY/CONFIDENTIAL. Use is subject to license terms.
6  */

7
8 package javax.lang.model.type;
9
10
11 import java.lang.annotation.Annotation JavaDoc;
12 import javax.lang.model.element.Element;
13
14
15 /**
16  * Thrown when an application attempts to access the {@link Class} object
17  * corresponding to a {@link TypeMirror}.
18  *
19  * @author Joseph D. Darcy
20  * @author Scott Seligman
21  * @author Peter von der Ahé
22  * @version 1.3 06/07/31
23  * @see MirroredTypesException
24  * @see Element#getAnnotation(Class)
25  * @since 1.6
26  */

27 public class MirroredTypeException extends RuntimeException JavaDoc {
28
29     private static final long serialVersionUID = 269;
30
31     private transient TypeMirror type; // cannot be serialized
32

33     /**
34      * Constructs a new MirroredTypeException for the specified type.
35      *
36      * @param type the type being accessed
37      */

38     public MirroredTypeException(TypeMirror type) {
39     super("Attempt to access Class object for TypeMirror " + type);
40     this.type = type;
41     }
42
43     /**
44      * Returns the type mirror corresponding to the type being accessed.
45      * The type mirror may be unavailable if this exception has been
46      * serialized and then read back in.
47      *
48      * @return the type mirror, or {@code null} if unavailable
49      */

50     public TypeMirror getTypeMirror() {
51     return type;
52     }
53 }
54
Popular Tags