net.sf.daileon.notsupported
Class AbstractAnnotationsReplacer

java.lang.Object
  extended by org.objectweb.asm.ClassAdapter
      extended by net.sf.daileon.notsupported.AbstractAnnotationsReplacerBase
          extended by net.sf.daileon.notsupported.AbstractAnnotationsReplacer
All Implemented Interfaces:
org.objectweb.asm.ClassVisitor
Direct Known Subclasses:
DomainAnnotationsDiscarder, DomainAnnotationsKeeper

public abstract class AbstractAnnotationsReplacer
extends AbstractAnnotationsReplacerBase

The AbstractAnnotationsReplacer class is responsible for visiting the elements of a particular class and organizing their annotations.

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

Field Summary
private  String className
          The name of the class whose elements will have their annotations organized
 
Fields inherited from class org.objectweb.asm.ClassAdapter
cv
 
Constructor Summary
protected AbstractAnnotationsReplacer(org.objectweb.asm.ClassVisitor classVisitor)
          Class constructor.
 
Method Summary
(package private)  void setClassName(String className)
          Sets the name of the class whose elements will have their annotations organized.
 void visitAttribute(org.objectweb.asm.Attribute attribute)
          Visits the annotations of a given class and calls the AbstractAnnotationsReplacerBase.handleElement(ElementRoot), so that their corresponding annotations can be organized.
 void visitField(int access, String name, String desc, Object value, org.objectweb.asm.Attribute attribute)
          Visits a particular field of a given class and calls the AbstractAnnotationsReplacerBase.handleElement(ElementRoot), so that its corresponding annotations can be organized.
 org.objectweb.asm.CodeVisitor visitMethod(int access, String name, String desc, String[] exceptions, org.objectweb.asm.Attribute attribute)
          Visits a particular method of a given class and calls the AbstractAnnotationsReplacerBase.handleElement(ElementRoot), so that its corresponding annotations can be organized.
 
Methods inherited from class net.sf.daileon.notsupported.AbstractAnnotationsReplacerBase
addDomainAnnotation, addElementAnnotations, handleElement, keepDomainAnnotations
 
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 whose elements will have their annotations organized

Constructor Detail

AbstractAnnotationsReplacer

protected AbstractAnnotationsReplacer(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 whose elements will have their annotations organized.

Parameters:
className - The name of the class.

visitAttribute

public void visitAttribute(org.objectweb.asm.Attribute attribute)
Visits the annotations of a given class and calls the AbstractAnnotationsReplacerBase.handleElement(ElementRoot), so that their corresponding annotations can be organized.

Specified by:
visitAttribute in interface org.objectweb.asm.ClassVisitor
Overrides:
visitAttribute in class org.objectweb.asm.ClassAdapter
Throws:
RuntimeException - If a DuplicateAnnotationException is caught when trying to organize the domain annotations of the class and their corresponding annotations.

visitField

public void visitField(int access,
                       String name,
                       String desc,
                       Object value,
                       org.objectweb.asm.Attribute attribute)
Visits a particular field of a given class and calls the AbstractAnnotationsReplacerBase.handleElement(ElementRoot), so that its corresponding annotations can be organized.

Specified by:
visitField in interface org.objectweb.asm.ClassVisitor
Overrides:
visitField in class org.objectweb.asm.ClassAdapter
Throws:
RuntimeException - If a DuplicateAnnotationException is caught when trying to organize the domain annotations of a particular field and its corresponding annotations.

visitMethod

public org.objectweb.asm.CodeVisitor visitMethod(int access,
                                                 String name,
                                                 String desc,
                                                 String[] exceptions,
                                                 org.objectweb.asm.Attribute attribute)
Visits a particular method of a given class and calls the AbstractAnnotationsReplacerBase.handleElement(ElementRoot), so that its corresponding annotations can be organized.

Specified by:
visitMethod in interface org.objectweb.asm.ClassVisitor
Overrides:
visitMethod in class org.objectweb.asm.ClassAdapter
Throws:
RuntimeException - If a DuplicateAnnotationException is caught when trying to organize the domain annotations of a particular method and its corresponding annotations.