com.sun.tools.javac.model
Class AnnotationProxyMaker

java.lang.Object
  extended by com.sun.tools.javac.model.AnnotationProxyMaker

public class AnnotationProxyMaker
extends java.lang.Object

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

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

This is NOT part of any API supported by Sun Microsystems. If you write code that depends on this, you do so at your own risk. This code and its internal interfaces are subject to change or deletion without notice.


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  Attribute.Compound anno
           
private  java.lang.Class<? extends java.lang.annotation.Annotation> annoType
           
 
Constructor Summary
private AnnotationProxyMaker(Attribute.Compound anno, 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(Attribute.Compound anno, 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

anno

private final Attribute.Compound anno

annoType

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

AnnotationProxyMaker

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

generateAnnotation

public static <A extends java.lang.annotation.Annotation> A generateAnnotation(Attribute.Compound anno,
                                                                               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.