org.apache.felix.ipojo.manipulation
Class ClassChecker.AnnotationDescriptor

java.lang.Object
  extended by org.apache.felix.ipojo.manipulation.ClassChecker.AnnotationDescriptor
All Implemented Interfaces:
org.objectweb.asm.AnnotationVisitor
Enclosing class:
ClassChecker

public class ClassChecker.AnnotationDescriptor
extends Object
implements org.objectweb.asm.AnnotationVisitor

Describes a method or constructor annotation. This allows creating a copy of the annotations found in the original class to move them on inserted method. This class implements an AnnotationVisitor in order to create the copy. This class contains a visit method re-injecting the annotation in the generated method.

Author:
Felix Project Team

Constructor Summary
ClassChecker.AnnotationDescriptor(String name, boolean visible)
          Creates an annotation descriptor.
ClassChecker.AnnotationDescriptor(String name, String desc)
          Creates an annotation descriptor.
 
Method Summary
 void visit(org.objectweb.asm.AnnotationVisitor mv)
          Method allowing to recreate the visited (stored) annotation into the destination annotation.
 void visit(String arg0, Object arg1)
          Visits a simple attribute.
 void visitAnnotation(org.objectweb.asm.MethodVisitor mv)
          Methods allowing to recreate the visited (stored) annotation into the destination method.
 org.objectweb.asm.AnnotationVisitor visitAnnotation(String arg0, String arg1)
          Visits a nested annotation.
 org.objectweb.asm.AnnotationVisitor visitArray(String arg0)
          Visits an array attribute.
 void visitEnd()
          End of the visit.
 void visitEnum(String arg0, String arg1, String arg2)
          Visits an enumeration attribute.
 void visitParameterAnnotation(int id, org.objectweb.asm.MethodVisitor mv)
          Methods allowing to recreate the visited (stored) parameter annotations into the destination method.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ClassChecker.AnnotationDescriptor

public ClassChecker.AnnotationDescriptor(String name,
                                         boolean visible)
Creates an annotation descriptor. This constructor is used for 'root' annotations.

Parameters:
name - the name of the annotation
visible - the visibility of the annotation at runtime

ClassChecker.AnnotationDescriptor

public ClassChecker.AnnotationDescriptor(String name,
                                         String desc)
Creates an annotation descriptor. This constructor is used for nested annotations.

Parameters:
name - the name of the annotation
desc - the descriptor of the annotation
Method Detail

visit

public void visit(String arg0,
                  Object arg1)
Visits a simple attribute.

Specified by:
visit in interface org.objectweb.asm.AnnotationVisitor
Parameters:
arg0 - the attribute name
arg1 - the attribute value
See Also:
AnnotationVisitor.visit(java.lang.String, java.lang.Object)

visitAnnotation

public org.objectweb.asm.AnnotationVisitor visitAnnotation(String arg0,
                                                           String arg1)
Visits a nested annotation.

Specified by:
visitAnnotation in interface org.objectweb.asm.AnnotationVisitor
Parameters:
arg0 - the attribute name
arg1 - the annotation descriptor
Returns:
the annotation visitor parsing the nested annotation
See Also:
AnnotationVisitor.visitAnnotation(java.lang.String, java.lang.String)

visitArray

public org.objectweb.asm.AnnotationVisitor visitArray(String arg0)
Visits an array attribute.

Specified by:
visitArray in interface org.objectweb.asm.AnnotationVisitor
Parameters:
arg0 - the name of the attribute
Returns:
the annotation visitor parsing the content of the array, uses a specific ClassChecker.ArrayAttribute to parse this array
See Also:
AnnotationVisitor.visitArray(java.lang.String)

visitEnd

public void visitEnd()
End of the visit.

Specified by:
visitEnd in interface org.objectweb.asm.AnnotationVisitor
See Also:
AnnotationVisitor.visitEnd()

visitEnum

public void visitEnum(String arg0,
                      String arg1,
                      String arg2)
Visits an enumeration attribute.

Specified by:
visitEnum in interface org.objectweb.asm.AnnotationVisitor
Parameters:
arg0 - the attribute name
arg1 - the enumeration descriptor
arg2 - the attribute value
See Also:
AnnotationVisitor.visitEnum(java.lang.String, java.lang.String, java.lang.String)

visitAnnotation

public void visitAnnotation(org.objectweb.asm.MethodVisitor mv)
Methods allowing to recreate the visited (stored) annotation into the destination method. This method recreate the annotations itself and any other attributes.

Parameters:
mv - the method visitor visiting the destination method.

visitParameterAnnotation

public void visitParameterAnnotation(int id,
                                     org.objectweb.asm.MethodVisitor mv)
Methods allowing to recreate the visited (stored) parameter annotations into the destination method. This method recreate the annotations itself and any other attributes.

Parameters:
id - the paramter id
mv - the method visitor visiting the destination method.

visit

public void visit(org.objectweb.asm.AnnotationVisitor mv)
Method allowing to recreate the visited (stored) annotation into the destination annotation. This method is used only for nested annotation.

Parameters:
mv - the annotation visitor to populate with the stored annotation


Copyright © 2013 The Apache Software Foundation. All Rights Reserved.