KickJava   Java API By Example, From Geeks To Geeks.

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


1 /*
2  * @(#)MirroredTypesException.java 1.4 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 java.util.ArrayList JavaDoc;
13 import java.util.List JavaDoc;
14 import java.util.Collections JavaDoc;
15
16 import javax.lang.model.element.Element;
17
18
19 /**
20  * Thrown when an application attempts to access a sequence of {@link
21  * Class} objects each corresponding to a {@link TypeMirror}.
22  *
23  * @author Joseph D. Darcy
24  * @author Scott Seligman
25  * @author Peter von der Ahé
26  * @version 1.4 06/07/31
27  * @see MirroredTypeException
28  * @see Element#getAnnotation(Class)
29  * @since 1.6
30  */

31 public class MirroredTypesException extends RuntimeException JavaDoc {
32
33     private static final long serialVersionUID = 269;
34
35     // Should this be non-final for a custum readObject method?
36
private final transient List JavaDoc<? extends TypeMirror> types; // cannot be serialized
37

38     /**
39      * Constructs a new MirroredTypesException for the specified types.
40      *
41      * @param types the types being accessed
42      */

43     public MirroredTypesException(List JavaDoc<? extends TypeMirror> types) {
44     super("Attempt to access Class objects for TypeMirrors " + types);
45     this.types = Collections.unmodifiableList(types);
46     }
47
48     /**
49      * Returns the type mirrors corresponding to the types being accessed.
50      * The type mirrors may be unavailable if this exception has been
51      * serialized and then read back in.
52      *
53      * @return the type mirrors in construction order, or {@code null} if unavailable
54      */

55     public List JavaDoc<? extends TypeMirror> getTypeMirrors() {
56     return types;
57     }
58 }
59
Popular Tags