src/share/classes/com/sun/tools/apt/mirror/declaration/AnnotationProxyMaker.java

Print this page




  32 import java.util.*;
  33 import sun.reflect.annotation.*;
  34 
  35 import com.sun.mirror.type.TypeMirror;
  36 import com.sun.mirror.type.MirroredTypeException;
  37 import com.sun.mirror.type.MirroredTypesException;
  38 import com.sun.tools.apt.mirror.AptEnv;
  39 import com.sun.tools.javac.code.*;
  40 import com.sun.tools.javac.code.Symbol.*;
  41 import com.sun.tools.javac.util.Name;
  42 import com.sun.tools.javac.util.Pair;
  43 
  44 
  45 /**
  46  * A generator of dynamic proxy implementations of
  47  * java.lang.annotation.Annotation.
  48  *
  49  * <p> The "dynamic proxy return form" of an attribute element value is
  50  * the form used by sun.reflect.annotation.AnnotationInvocationHandler.
  51  */
  52 
  53 class AnnotationProxyMaker {
  54 
  55     private final AptEnv env;
  56     private final Attribute.Compound attrs;
  57     private final Class<? extends Annotation> annoType;
  58 
  59 
  60     private AnnotationProxyMaker(AptEnv env,
  61                                  Attribute.Compound attrs,
  62                                  Class<? extends Annotation> annoType) {
  63         this.env = env;
  64         this.attrs = attrs;
  65         this.annoType = annoType;
  66     }
  67 
  68 
  69     /**
  70      * Returns a dynamic proxy for an annotation mirror.
  71      */
  72     public static <A extends Annotation> A generateAnnotation(




  32 import java.util.*;
  33 import sun.reflect.annotation.*;
  34 
  35 import com.sun.mirror.type.TypeMirror;
  36 import com.sun.mirror.type.MirroredTypeException;
  37 import com.sun.mirror.type.MirroredTypesException;
  38 import com.sun.tools.apt.mirror.AptEnv;
  39 import com.sun.tools.javac.code.*;
  40 import com.sun.tools.javac.code.Symbol.*;
  41 import com.sun.tools.javac.util.Name;
  42 import com.sun.tools.javac.util.Pair;
  43 
  44 
  45 /**
  46  * A generator of dynamic proxy implementations of
  47  * java.lang.annotation.Annotation.
  48  *
  49  * <p> The "dynamic proxy return form" of an attribute element value is
  50  * the form used by sun.reflect.annotation.AnnotationInvocationHandler.
  51  */
  52 @SuppressWarnings("deprecation")
  53 class AnnotationProxyMaker {
  54 
  55     private final AptEnv env;
  56     private final Attribute.Compound attrs;
  57     private final Class<? extends Annotation> annoType;
  58 
  59 
  60     private AnnotationProxyMaker(AptEnv env,
  61                                  Attribute.Compound attrs,
  62                                  Class<? extends Annotation> annoType) {
  63         this.env = env;
  64         this.attrs = attrs;
  65         this.annoType = annoType;
  66     }
  67 
  68 
  69     /**
  70      * Returns a dynamic proxy for an annotation mirror.
  71      */
  72     public static <A extends Annotation> A generateAnnotation(