com.sun.tools.apt.mirror.declaration
Class AnnotationProxyMaker

java.lang.Object
  extended by com.sun.tools.apt.mirror.declaration.AnnotationProxyMaker

 class AnnotationProxyMaker
extends java.lang.Object

A generator of dynamic proxy implementations of java.lang.annotation.Annotation.

The "dynamic proxy return form" of an attribute element value is the form used by sun.reflect.annotation.AnnotationInvocationHandler.


Nested Class Summary
private static class AnnotationProxyMaker.MirroredTypeExceptionProxy
          ExceptionProxy for MirroredTypeException.
private static class AnnotationProxyMaker.MirroredTypesExceptionProxy
          ExceptionProxy for MirroredTypesException.
private  class AnnotationProxyMaker.ValueVisitor
           
 
Field Summary
private  java.lang.Class<? extends java.lang.annotation.Annotation> annoType
           
private  Attribute.Compound attrs
           
private  AptEnv env
           
 
Constructor Summary
private AnnotationProxyMaker(AptEnv env, Attribute.Compound attrs, java.lang.Class<? extends java.lang.annotation.Annotation> annoType)
           
 
Method Summary
private  java.lang.annotation.Annotation generateAnnotation()
          Returns a dynamic proxy for an annotation mirror.
static
<A extends java.lang.annotation.Annotation>
A
generateAnnotation(AptEnv env, Attribute.Compound attrs, java.lang.Class<A> annoType)
          Returns a dynamic proxy for an annotation mirror.
private  java.lang.Object generateValue(Symbol.MethodSymbol meth, Attribute attr)
          Converts an element value to its "dynamic proxy return form".
private  java.util.Map<java.lang.String,java.lang.Object> getAllReflectedValues()
          Returns a map from element names to their values in "dynamic proxy return form".
private  java.util.Map<Symbol.MethodSymbol,Attribute> getAllValues()
          Returns a map from element symbols to their values.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

env

private final AptEnv env

attrs

private final Attribute.Compound attrs

annoType

private final java.lang.Class<? extends java.lang.annotation.Annotation> annoType
Constructor Detail

AnnotationProxyMaker

private AnnotationProxyMaker(AptEnv env,
                             Attribute.Compound attrs,
                             java.lang.Class<? extends java.lang.annotation.Annotation> annoType)
Method Detail

generateAnnotation

public static <A extends java.lang.annotation.Annotation> A generateAnnotation(AptEnv env,
                                                                               Attribute.Compound attrs,
                                                                               java.lang.Class<A> annoType)
Returns a dynamic proxy for an annotation mirror.


generateAnnotation

private java.lang.annotation.Annotation generateAnnotation()
Returns a dynamic proxy for an annotation mirror.


getAllReflectedValues

private java.util.Map<java.lang.String,java.lang.Object> getAllReflectedValues()
Returns a map from element names to their values in "dynamic proxy return form". Includes all elements, whether explicit or defaulted.


getAllValues

private java.util.Map<Symbol.MethodSymbol,Attribute> getAllValues()
Returns a map from element symbols to their values. Includes all elements, whether explicit or defaulted.


generateValue

private java.lang.Object generateValue(Symbol.MethodSymbol meth,
                                       Attribute attr)
Converts an element value to its "dynamic proxy return form". Returns an exception proxy on some errors, but may return null if a useful exception cannot or should not be generated at this point.