Package proguard.classfile.editor
Class AnnotationAdder
- java.lang.Object
-
- proguard.classfile.editor.AnnotationAdder
-
- All Implemented Interfaces:
AnnotationVisitor
public class AnnotationAdder extends java.lang.Object implements AnnotationVisitor
ThisAnnotationVisitor
adds all annotations that it visits to the given target annotation element value, target annotation attribute, or target parameter annotation attribute.
-
-
Constructor Summary
Constructors Constructor Description 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
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
visitAnnotation(Clazz clazz, Annotation annotation)
Visits any Annotation instance.void
visitAnnotation(Clazz clazz, Method method, int parameterIndex, Annotation annotation)
-
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, 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)
Description copied from interface:AnnotationVisitor
Visits any Annotation instance. The more specific default implementations of this interface delegate to this method.- Specified by:
visitAnnotation
in interfaceAnnotationVisitor
-
visitAnnotation
public void visitAnnotation(Clazz clazz, Method method, int parameterIndex, Annotation annotation)
- Specified by:
visitAnnotation
in interfaceAnnotationVisitor
-
-