net.sf.retrotranslator.runtime.impl
Class AnnotatedElementDescriptor

java.lang.Object
  extended by net.sf.retrotranslator.runtime.impl.EmptyVisitor
      extended by net.sf.retrotranslator.runtime.impl.AnnotatedElementDescriptor
All Implemented Interfaces:
AnnotationVisitor, ClassVisitor, FieldVisitor, MethodVisitor, SignatureVisitor
Direct Known Subclasses:
FieldDescriptor, GenericDeclarationDescriptor

public abstract class AnnotatedElementDescriptor
extends EmptyVisitor

Author:
Taras Puchko

Field Summary
protected  int access
           
private  LazyValue<LazyList<AnnotationValue,Annotation_>,Annotation_[]> annotations
           
private  LazyList<AnnotationValue,Annotation_> declaredAnnotations
           
private static Annotation_[] EMPTY
           
protected static EmptyVisitor EMPTY_VISITOR
           
 
Fields inherited from interface net.sf.retrotranslator.runtime.asm.signature.SignatureVisitor
EXTENDS, INSTANCEOF, SUPER
 
Constructor Summary
AnnotatedElementDescriptor()
           
 
Method Summary
private static void append(java.lang.StringBuffer buffer, java.lang.Object value)
           
private  Annotation_ createAnnotation(AnnotationValue annotationValue)
           
protected abstract  Annotation_[] createAnnotations(Annotation_[] declaredAnnotations)
           
protected  Annotation_[] createAnnotations(java.util.List<AnnotationValue> values)
           
private  java.lang.reflect.Type[] createArguments(java.util.List<TypeArgument> arguments)
           
private  java.lang.reflect.Type createClassType(ClassTypeElement[] typeElements)
           
 java.lang.reflect.Type createType(TypeDescriptor descriptor)
           
 java.lang.reflect.Type[] createTypes(java.util.List<TypeDescriptor> descriptors)
           
protected abstract  java.lang.reflect.TypeVariable findTypeVariable(java.lang.String name)
           
 Annotation_ getAnnotation(java.lang.Class annotationType)
           
 Annotation_[] getAnnotations()
           
private  java.lang.Class getClassByDesc(java.lang.String desc)
           
protected  java.lang.Class getClassByInternalName(java.lang.String name)
           
protected  java.lang.Class getClassByType(Type type)
           
abstract  ClassDescriptor getClassDescriptor()
           
private  java.lang.ClassLoader getClassLoader()
           
 Annotation_[] getDeclaredAnnotations()
           
private  java.lang.Object getEnumValue(java.lang.Class enumType, java.lang.String name)
           
protected  LazyList<TypeDescriptor,java.lang.reflect.Type> getLazyList()
           
protected  LazyValue<TypeDescriptor,java.lang.reflect.Type> getLazyType(TypeDescriptor descriptor)
           
private  java.lang.ClassLoader getProxyClassLoader(java.lang.Class annotationType)
           
 boolean isAccess(int mask)
           
 boolean isAnnotationPresent(java.lang.Class annotationType)
           
protected  java.lang.Object resolveValue(java.lang.Object value, java.lang.Class type, MethodDescriptor descriptor)
           
 AnnotationVisitor visitAnnotation(java.lang.String desc, boolean visible)
          Visits an annotation of the class.
 
Methods inherited from class net.sf.retrotranslator.runtime.impl.EmptyVisitor
visit, visit, visitAnnotation, visitAnnotationDefault, visitArray, visitArrayType, visitAttribute, visitBaseType, visitClassBound, visitClassType, visitCode, visitEnd, visitEnum, visitExceptionType, visitField, visitFieldInsn, visitFormalTypeParameter, visitIincInsn, visitInnerClass, visitInnerClassType, visitInsn, visitInterface, visitInterfaceBound, visitIntInsn, visitJumpInsn, visitLabel, visitLdcInsn, visitLineNumber, visitLocalVariable, visitLookupSwitchInsn, visitMaxs, visitMethod, visitMethodInsn, visitMultiANewArrayInsn, visitOuterClass, visitParameterAnnotation, visitParameterType, visitReturnType, visitSource, visitSuperclass, visitTableSwitchInsn, visitTryCatchBlock, visitTypeArgument, visitTypeArgument, visitTypeInsn, visitTypeVariable, visitVarInsn
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

EMPTY

private static final Annotation_[] EMPTY

EMPTY_VISITOR

protected static final EmptyVisitor EMPTY_VISITOR

access

protected int access

declaredAnnotations

private LazyList<AnnotationValue,Annotation_> declaredAnnotations

annotations

private LazyValue<LazyList<AnnotationValue,Annotation_>,Annotation_[]> annotations
Constructor Detail

AnnotatedElementDescriptor

public AnnotatedElementDescriptor()
Method Detail

isAccess

public boolean isAccess(int mask)

isAnnotationPresent

public boolean isAnnotationPresent(java.lang.Class annotationType)

getAnnotation

public Annotation_ getAnnotation(java.lang.Class annotationType)

getAnnotations

public Annotation_[] getAnnotations()

getDeclaredAnnotations

public Annotation_[] getDeclaredAnnotations()

getClassDescriptor

public abstract ClassDescriptor getClassDescriptor()

findTypeVariable

protected abstract java.lang.reflect.TypeVariable findTypeVariable(java.lang.String name)

createAnnotations

protected abstract Annotation_[] createAnnotations(Annotation_[] declaredAnnotations)

createAnnotations

protected Annotation_[] createAnnotations(java.util.List<AnnotationValue> values)

visitAnnotation

public AnnotationVisitor visitAnnotation(java.lang.String desc,
                                         boolean visible)
Description copied from interface: ClassVisitor
Visits an annotation of the class.

Specified by:
visitAnnotation in interface ClassVisitor
Specified by:
visitAnnotation in interface FieldVisitor
Specified by:
visitAnnotation in interface MethodVisitor
Overrides:
visitAnnotation in class EmptyVisitor
Parameters:
desc - the class descriptor of the annotation class.
visible - true if the annotation is visible at runtime.
Returns:
a non null visitor to visit the annotation values.

getClassLoader

private java.lang.ClassLoader getClassLoader()

getClassByInternalName

protected java.lang.Class getClassByInternalName(java.lang.String name)

getClassByType

protected java.lang.Class getClassByType(Type type)

getClassByDesc

private java.lang.Class getClassByDesc(java.lang.String desc)

createTypes

public java.lang.reflect.Type[] createTypes(java.util.List<TypeDescriptor> descriptors)

createType

public java.lang.reflect.Type createType(TypeDescriptor descriptor)

createClassType

private java.lang.reflect.Type createClassType(ClassTypeElement[] typeElements)

createArguments

private java.lang.reflect.Type[] createArguments(java.util.List<TypeArgument> arguments)

createAnnotation

private Annotation_ createAnnotation(AnnotationValue annotationValue)

getProxyClassLoader

private java.lang.ClassLoader getProxyClassLoader(java.lang.Class annotationType)

resolveValue

protected java.lang.Object resolveValue(java.lang.Object value,
                                        java.lang.Class type,
                                        MethodDescriptor descriptor)

getEnumValue

private java.lang.Object getEnumValue(java.lang.Class enumType,
                                      java.lang.String name)

append

private static void append(java.lang.StringBuffer buffer,
                           java.lang.Object value)

getLazyType

protected LazyValue<TypeDescriptor,java.lang.reflect.Type> getLazyType(TypeDescriptor descriptor)

getLazyList

protected LazyList<TypeDescriptor,java.lang.reflect.Type> getLazyList()