proguard.classfile.editor
Class AnnotationAdder

java.lang.Object
  extended by proguard.classfile.util.SimplifiedVisitor
      extended by proguard.classfile.editor.AnnotationAdder
All Implemented Interfaces:
AnnotationVisitor

public class AnnotationAdder
extends SimplifiedVisitor
implements AnnotationVisitor

This AnnotationVisitor adds all annotations that it visits to the given target annotation element value, target annotation attribute, or target parameter annotation attribute.


Constructor Summary
AnnotationAdder(ProgramClass targetClass, AnnotationElementValue targetAnnotationElementValue)
          Creates a new AnnotationAdder that will copy annotations into the given target annotation element value.
AnnotationAdder(ProgramClass targetClass, AnnotationsAttribute targetAnnotationsAttribute)
          Creates a new AnnotationAdder that will copy annotations into the given target annotations attribute.
AnnotationAdder(ProgramClass targetClass, ParameterAnnotationsAttribute targetParameterAnnotationsAttribute)
          Creates a new AnnotationAdder that will copy annotations into the given target parameter annotations attribute.
 
Method Summary
 void visitAnnotation(Clazz clazz, Annotation annotation)
           
 void visitAnnotation(Clazz clazz, Method method, int parameterIndex, Annotation annotation)
           
 
Methods inherited from class proguard.classfile.util.SimplifiedVisitor
visitAnnotation, visitAnnotation, visitAnnotation, visitAnnotationDefaultAttribute, visitAnnotationElementValue, visitAnyAnnotationsAttribute, visitAnyAttribute, visitAnyClass, visitAnyConstant, visitAnyElementValue, visitAnyInstruction, visitAnyMember, visitAnyMethodrefConstant, visitAnyParameterAnnotationsAttribute, visitAnyRefConstant, visitAnyStackMapFrame, visitAnySwitchInstruction, visitAnyVerificationType, visitArrayElementValue, visitBranchInstruction, visitClassConstant, visitClassElementValue, visitCodeAttribute, visitConstantElementValue, visitConstantInstruction, visitConstantValueAttribute, visitDeprecatedAttribute, visitDeprecatedAttribute, visitDeprecatedAttribute, visitDeprecatedAttribute, visitDoubleConstant, visitDoubleType, visitEnclosingMethodAttribute, visitEnumConstantElementValue, visitExceptionsAttribute, visitFieldrefConstant, visitFloatConstant, visitFloatType, visitFullFrame, visitInnerClassesAttribute, visitIntegerConstant, visitIntegerType, visitInterfaceMethodrefConstant, visitLessZeroFrame, visitLibraryClass, visitLibraryField, visitLibraryMember, visitLibraryMethod, visitLineNumberTableAttribute, visitLocalVariableTableAttribute, visitLocalVariableTypeTableAttribute, visitLongConstant, visitLongType, visitLookUpSwitchInstruction, visitMethodrefConstant, visitMoreZeroFrame, visitNameAndTypeConstant, visitNullType, visitObjectType, visitProgramClass, visitProgramField, visitProgramMember, visitProgramMethod, visitRuntimeInvisibleAnnotationsAttribute, visitRuntimeInvisibleAnnotationsAttribute, visitRuntimeInvisibleAnnotationsAttribute, visitRuntimeInvisibleAnnotationsAttribute, visitRuntimeInvisibleParameterAnnotationsAttribute, visitRuntimeVisibleAnnotationsAttribute, visitRuntimeVisibleAnnotationsAttribute, visitRuntimeVisibleAnnotationsAttribute, visitRuntimeVisibleAnnotationsAttribute, visitRuntimeVisibleParameterAnnotationsAttribute, visitSameOneFrame, visitSameZeroFrame, visitSignatureAttribute, visitSignatureAttribute, visitSignatureAttribute, visitSignatureAttribute, visitSimpleInstruction, visitSourceDirAttribute, visitSourceFileAttribute, visitStackDoubleType, visitStackFloatType, visitStackIntegerType, visitStackLongType, visitStackMapAttribute, visitStackMapTableAttribute, visitStackNullType, visitStackObjectType, visitStackTopType, visitStackUninitializedThisType, visitStackUninitializedType, visitStringConstant, visitSyntheticAttribute, visitSyntheticAttribute, visitSyntheticAttribute, visitSyntheticAttribute, visitTableSwitchInstruction, visitTopType, visitUninitializedThisType, visitUninitializedType, visitUnknownAttribute, visitUtf8Constant, visitVariableInstruction, visitVariablesDoubleType, visitVariablesFloatType, visitVariablesIntegerType, visitVariablesLongType, visitVariablesNullType, visitVariablesObjectType, visitVariablesTopType, visitVariablesUninitializedThisType, visitVariablesUninitializedType
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface proguard.classfile.attribute.annotation.visitor.AnnotationVisitor
visitAnnotation, visitAnnotation
 

Constructor Detail

AnnotationAdder

public AnnotationAdder(ProgramClass targetClass,
                       AnnotationElementValue targetAnnotationElementValue)
Creates a new AnnotationAdder that will copy annotations into the given target annotation element value.


AnnotationAdder

public AnnotationAdder(ProgramClass targetClass,
                       AnnotationsAttribute targetAnnotationsAttribute)
Creates a new AnnotationAdder that will copy annotations into the given target annotations attribute.


AnnotationAdder

public AnnotationAdder(ProgramClass targetClass,
                       ParameterAnnotationsAttribute targetParameterAnnotationsAttribute)
Creates a new AnnotationAdder that will copy annotations into the given target parameter annotations attribute.

Method Detail

visitAnnotation

public void visitAnnotation(Clazz clazz,
                            Annotation annotation)
Specified by:
visitAnnotation in interface AnnotationVisitor
Overrides:
visitAnnotation in class SimplifiedVisitor

visitAnnotation

public void visitAnnotation(Clazz clazz,
                            Method method,
                            int parameterIndex,
                            Annotation annotation)
Specified by:
visitAnnotation in interface AnnotationVisitor
Overrides:
visitAnnotation in class SimplifiedVisitor