org.objectweb.easybeans.deployment.annotations.analyzer
Class ScanMethodVisitor

java.lang.Object
  extended by org.objectweb.asm.commons.EmptyVisitor
      extended by org.objectweb.easybeans.deployment.annotations.analyzer.ScanMethodVisitor
All Implemented Interfaces:
org.objectweb.asm.AnnotationVisitor, org.objectweb.asm.ClassVisitor, org.objectweb.asm.FieldVisitor, org.objectweb.asm.MethodVisitor

public class ScanMethodVisitor
extends org.objectweb.asm.commons.EmptyVisitor
implements org.objectweb.asm.MethodVisitor

This classes analyses a given method and build/fill meta data information.

Author:
Florent Benoit

Field Summary
private  ClassAnnotationMetadata classAnnotationMetadata
          Parent of method annotation meta data that are built by this visitor.
private  org.objectweb.asm.commons.EmptyVisitor emptyVisitor
          Annotation visitor which do nothing.
private  MethodAnnotationMetadata methodAnnotationMetadata
          Class generated by the visitor which correspond to meta data contained in the parsed method.
private  java.util.Map<java.lang.String,org.objectweb.asm.AnnotationVisitor> methodAnnotationVisitors
          Map of annotation visitors used by this visitor.
The key is the annotation descriptor (asm)
 
Constructor Summary
ScanMethodVisitor(JMethod jMethod, ClassAnnotationMetadata classAnnotationMetadata)
          Constructor.
 
Method Summary
private  void initVisitors()
          Build visitors used by this one.
 org.objectweb.asm.AnnotationVisitor visitAnnotation(java.lang.String desc, boolean visible)
          Visits an annotation of this method.
 org.objectweb.asm.AnnotationVisitor visitAnnotationDefault()
          Visits the default value of this annotation interface method.
 void visitEnd()
          Visits the end of the method.
 
Methods inherited from class org.objectweb.asm.commons.EmptyVisitor
visit, visit, visitAnnotation, visitArray, visitAttribute, visitCode, visitEnum, visitField, visitFieldInsn, visitIincInsn, visitInnerClass, visitInsn, visitIntInsn, visitJumpInsn, visitLabel, visitLdcInsn, visitLineNumber, visitLocalVariable, visitLookupSwitchInsn, visitMaxs, visitMethod, visitMethodInsn, visitMultiANewArrayInsn, visitOuterClass, visitParameterAnnotation, visitSource, visitTableSwitchInsn, visitTryCatchBlock, visitTypeInsn, visitVarInsn
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.objectweb.asm.MethodVisitor
visitAttribute, visitCode, visitFieldInsn, visitIincInsn, visitInsn, visitIntInsn, visitJumpInsn, visitLabel, visitLdcInsn, visitLineNumber, visitLocalVariable, visitLookupSwitchInsn, visitMaxs, visitMethodInsn, visitMultiANewArrayInsn, visitParameterAnnotation, visitTableSwitchInsn, visitTryCatchBlock, visitTypeInsn, visitVarInsn
 

Field Detail

emptyVisitor

private org.objectweb.asm.commons.EmptyVisitor emptyVisitor
Annotation visitor which do nothing.


methodAnnotationMetadata

private MethodAnnotationMetadata methodAnnotationMetadata
Class generated by the visitor which correspond to meta data contained in the parsed method.


methodAnnotationVisitors

private java.util.Map<java.lang.String,org.objectweb.asm.AnnotationVisitor> methodAnnotationVisitors
Map of annotation visitors used by this visitor.
The key is the annotation descriptor (asm)


classAnnotationMetadata

private ClassAnnotationMetadata classAnnotationMetadata
Parent of method annotation meta data that are built by this visitor.

Constructor Detail

ScanMethodVisitor

public ScanMethodVisitor(JMethod jMethod,
                         ClassAnnotationMetadata classAnnotationMetadata)
Constructor.

Parameters:
jMethod - Method object on which we set meta data.
classAnnotationMetadata - the parent object on which add generated meta-data.
Method Detail

initVisitors

private void initVisitors()
Build visitors used by this one.


visitAnnotationDefault

public org.objectweb.asm.AnnotationVisitor visitAnnotationDefault()
Visits the default value of this annotation interface method.

Specified by:
visitAnnotationDefault in interface org.objectweb.asm.MethodVisitor
Overrides:
visitAnnotationDefault in class org.objectweb.asm.commons.EmptyVisitor
Returns:
a non null visitor to the visit the actual default value of this annotation interface method. The 'name' parameters passed to the methods of this annotation visitor are ignored. Moreover, exacly one visit method must be called on this annotation visitor, followed by visitEnd.

visitAnnotation

public org.objectweb.asm.AnnotationVisitor visitAnnotation(java.lang.String desc,
                                                           boolean visible)
Visits an annotation of this method.

Specified by:
visitAnnotation in interface org.objectweb.asm.ClassVisitor
Specified by:
visitAnnotation in interface org.objectweb.asm.FieldVisitor
Specified by:
visitAnnotation in interface org.objectweb.asm.MethodVisitor
Overrides:
visitAnnotation in class org.objectweb.asm.commons.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.

visitEnd

public void visitEnd()
Visits the end of the method. This method, which is the last one to be called, is used to inform the visitor that all the annotations and attributes of the method have been visited.

Specified by:
visitEnd in interface org.objectweb.asm.AnnotationVisitor
Specified by:
visitEnd in interface org.objectweb.asm.ClassVisitor
Specified by:
visitEnd in interface org.objectweb.asm.FieldVisitor
Specified by:
visitEnd in interface org.objectweb.asm.MethodVisitor
Overrides:
visitEnd in class org.objectweb.asm.commons.EmptyVisitor