src/share/classes/com/sun/mirror/type/MirroredTypesException.java

Print this page




  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 com.sun.mirror.type;
  27 
  28 
  29 import java.lang.annotation.Annotation;
  30 import java.util.ArrayList;
  31 import java.util.Collection;
  32 import java.util.Collections;
  33 
  34 import com.sun.mirror.declaration.Declaration;
  35 
  36 
  37 /**
  38  * Thrown when an application attempts to access a sequence of {@link Class}
  39  * objects each corresponding to a {@link TypeMirror}.
  40  *





  41  * @see MirroredTypeException
  42  * @see Declaration#getAnnotation(Class)
  43  */


  44 public class MirroredTypesException extends RuntimeException {
  45 
  46     private static final long serialVersionUID = 1;
  47 
  48     private transient Collection<TypeMirror> types;     // cannot be serialized
  49     private Collection<String> names;           // types' qualified "names"
  50 
  51     /**
  52      * Constructs a new MirroredTypesException for the specified types.
  53      *
  54      * @param types  an ordered collection of the types being accessed
  55      */
  56     public MirroredTypesException(Collection<TypeMirror> types) {
  57         super("Attempt to access Class objects for TypeMirrors " + types);
  58         this.types = types;
  59         names = new ArrayList<String>();
  60         for (TypeMirror t : types) {
  61             names.add(t.toString());
  62         }
  63     }




  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 com.sun.mirror.type;
  27 
  28 
  29 import java.lang.annotation.Annotation;
  30 import java.util.ArrayList;
  31 import java.util.Collection;
  32 import java.util.Collections;
  33 
  34 import com.sun.mirror.declaration.Declaration;
  35 
  36 
  37 /**
  38  * Thrown when an application attempts to access a sequence of {@link Class}
  39  * objects each corresponding to a {@link TypeMirror}.
  40  *
  41  * @deprecated All components of this API have been superseded by the
  42  * standardized annotation processing API.  The replacement for the
  43  * functionality of this exception is {@link
  44  * javax.lang.model.type.MirroredTypesException}.
  45  *
  46  * @see MirroredTypeException
  47  * @see Declaration#getAnnotation(Class)
  48  */
  49 @Deprecated
  50 @SuppressWarnings("deprecation")
  51 public class MirroredTypesException extends RuntimeException {
  52 
  53     private static final long serialVersionUID = 1;
  54 
  55     private transient Collection<TypeMirror> types;     // cannot be serialized
  56     private Collection<String> names;           // types' qualified "names"
  57 
  58     /**
  59      * Constructs a new MirroredTypesException for the specified types.
  60      *
  61      * @param types  an ordered collection of the types being accessed
  62      */
  63     public MirroredTypesException(Collection<TypeMirror> types) {
  64         super("Attempt to access Class objects for TypeMirrors " + types);
  65         this.types = types;
  66         names = new ArrayList<String>();
  67         for (TypeMirror t : types) {
  68             names.add(t.toString());
  69         }
  70     }