net.sf.daileon.notsupported
Class AnnotationsCollector

java.lang.Object
  extended by org.objectweb.asm.ClassAdapter
      extended by net.sf.daileon.notsupported.AbstractAnnotationsCollector
          extended by net.sf.daileon.notsupported.AnnotationsCollector
All Implemented Interfaces:
org.objectweb.asm.ClassVisitor

 class AnnotationsCollector
extends AbstractAnnotationsCollector

The AnnotationsCollector class is responsible for visiting the annotations of a particular class, as well as its fields and methods.
Classes visited by the AnnotationsCollector should have domain annotations, which are evaluated to their corresponding annotations and prepared for transformations at bytecode level.

Version:
1.0 01/01/2010
Author:
Roberto Perillo

Field Summary
private  String className
          The name of the class to be visted
 
Fields inherited from class org.objectweb.asm.ClassAdapter
cv
 
Constructor Summary
AnnotationsCollector(org.objectweb.asm.ClassVisitor classVisitor)
          Class constructor.
 
Method Summary
(package private)  void setClassName(String className)
          Sets the name of the class to be visited.
 void visitAttribute(org.objectweb.asm.Attribute attribute)
          Visits the annotations of a given class, which will be verified.
 void visitField(int access, String name, String desc, Object value, org.objectweb.asm.Attribute attribute)
          Visits a field of a given class.
 org.objectweb.asm.CodeVisitor visitMethod(int access, String name, String desc, String[] exceptions, org.objectweb.asm.Attribute attribute)
          Visits a method of a given class.
 
Methods inherited from class net.sf.daileon.notsupported.AbstractAnnotationsCollector
collect, setPath, setReplacer
 
Methods inherited from class org.objectweb.asm.ClassAdapter
visit, visitEnd, visitInnerClass
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

className

private String className
The name of the class to be visted

Constructor Detail

AnnotationsCollector

AnnotationsCollector(org.objectweb.asm.ClassVisitor classVisitor)
Class constructor.

Parameters:
classVisitor - The ClassVisitor object, provided by the ClassTransformer.transform(String, String) method.
Method Detail

setClassName

void setClassName(String className)
Sets the name of the class to be visited.

Parameters:
className - The name of the class to be visited.

visitAttribute

public void visitAttribute(org.objectweb.asm.Attribute attribute)
Visits the annotations of a given class, which will be verified. If domain annotations are found, they are evaluated to their corresponding annotations and prepared for transformations at bytecode level.

Specified by:
visitAttribute in interface org.objectweb.asm.ClassVisitor
Overrides:
visitAttribute in class org.objectweb.asm.ClassAdapter
Parameters:
attribute - The Attribute object (or the annotations at class level), which may contain one or several annotations.

visitField

public void visitField(int access,
                       String name,
                       String desc,
                       Object value,
                       org.objectweb.asm.Attribute attribute)
Visits a field of a given class. If domain annotations are found on it, they are evaluated to their corresponding annotations and prepared for transformations at bytecode level.

Specified by:
visitField in interface org.objectweb.asm.ClassVisitor
Overrides:
visitField in class org.objectweb.asm.ClassAdapter
Parameters:
access - The access level of the field.
name - The name of the field.
desc - The description of the field.
value - The default value of the field.
attribute - The Attribute object (or the annotations that annotate the field), which may contain one or several annotations.

visitMethod

public org.objectweb.asm.CodeVisitor visitMethod(int access,
                                                 String name,
                                                 String desc,
                                                 String[] exceptions,
                                                 org.objectweb.asm.Attribute attribute)
Visits a method of a given class. If domain annotations are found on it, they are evaluated to their corresponding annotations and prepared for transformations at bytecode level.

Specified by:
visitMethod in interface org.objectweb.asm.ClassVisitor
Overrides:
visitMethod in class org.objectweb.asm.ClassAdapter
Parameters:
access - The access level of the field.
name - The name of the field.
desc - The description of the field.
exceptions - The exceptions declared by the method.
attribute - The Attribute object (or the annotations that annotate the method), which may contain one or several annotations.
Returns:
null, since the method is only visited so its annotations can be evaluated and organized properly, if domain annotations are found on it.