Package proguard.classfile.editor
Class AttributeAdder
- java.lang.Object
-
- proguard.classfile.editor.AttributeAdder
-
- All Implemented Interfaces:
AttributeVisitor
public class AttributeAdder extends java.lang.Object implements AttributeVisitor
ThisAttributeVisitor
adds all attributes that it visits to the given target class, class member, or attribute.
-
-
Constructor Summary
Constructors Constructor Description AttributeAdder(ProgramClass targetClass, boolean replaceAttributes)
Creates a new AttributeAdder that will copy attributes into the given target class.AttributeAdder(ProgramClass targetClass, ProgramMember targetMember, boolean replaceAttributes)
Creates a new AttributeAdder that will copy attributes into the given target class member.AttributeAdder(ProgramClass targetClass, ProgramMember targetMember, CodeAttribute targetCodeAttribute, boolean replaceAttributes)
Creates a new AttributeAdder that will copy attributes into the given target attribute.
-
Method Summary
-
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.visitor.AttributeVisitor
visitAnyAnnotationsAttribute, visitAnyAttribute, visitAnyParameterAnnotationsAttribute, visitAnyTypeAnnotationsAttribute, visitBootstrapMethodsAttribute, visitDeprecatedAttribute, visitDeprecatedAttribute, visitDeprecatedAttribute, visitModuleAttribute, visitModuleMainClassAttribute, visitModulePackagesAttribute, visitRecordAttribute, visitRuntimeInvisibleAnnotationsAttribute, visitRuntimeInvisibleAnnotationsAttribute, visitRuntimeInvisibleAnnotationsAttribute, visitRuntimeInvisibleAnnotationsAttribute, visitRuntimeInvisibleTypeAnnotationsAttribute, visitRuntimeInvisibleTypeAnnotationsAttribute, visitRuntimeInvisibleTypeAnnotationsAttribute, visitRuntimeInvisibleTypeAnnotationsAttribute, visitRuntimeInvisibleTypeAnnotationsAttribute, visitRuntimeVisibleAnnotationsAttribute, visitRuntimeVisibleAnnotationsAttribute, visitRuntimeVisibleAnnotationsAttribute, visitRuntimeVisibleAnnotationsAttribute, visitRuntimeVisibleTypeAnnotationsAttribute, visitRuntimeVisibleTypeAnnotationsAttribute, visitRuntimeVisibleTypeAnnotationsAttribute, visitRuntimeVisibleTypeAnnotationsAttribute, visitRuntimeVisibleTypeAnnotationsAttribute, visitSignatureAttribute, visitSignatureAttribute, visitSignatureAttribute, visitSignatureAttribute, visitSyntheticAttribute, visitSyntheticAttribute, visitSyntheticAttribute
-
-
-
-
Constructor Detail
-
AttributeAdder
public AttributeAdder(ProgramClass targetClass, boolean replaceAttributes)
Creates a new AttributeAdder that will copy attributes into the given target class.
-
AttributeAdder
public AttributeAdder(ProgramClass targetClass, ProgramMember targetMember, boolean replaceAttributes)
Creates a new AttributeAdder that will copy attributes into the given target class member.
-
AttributeAdder
public AttributeAdder(ProgramClass targetClass, ProgramMember targetMember, CodeAttribute targetCodeAttribute, boolean replaceAttributes)
Creates a new AttributeAdder that will copy attributes into the given target attribute.
-
-
Method Detail
-
visitUnknownAttribute
public void visitUnknownAttribute(Clazz clazz, UnknownAttribute unknownAttribute)
- Specified by:
visitUnknownAttribute
in interfaceAttributeVisitor
-
visitSourceFileAttribute
public void visitSourceFileAttribute(Clazz clazz, SourceFileAttribute sourceFileAttribute)
- Specified by:
visitSourceFileAttribute
in interfaceAttributeVisitor
-
visitSourceDirAttribute
public void visitSourceDirAttribute(Clazz clazz, SourceDirAttribute sourceDirAttribute)
- Specified by:
visitSourceDirAttribute
in interfaceAttributeVisitor
-
visitSourceDebugExtensionAttribute
public void visitSourceDebugExtensionAttribute(Clazz clazz, SourceDebugExtensionAttribute sourceDebugExtensionAttribute)
- Specified by:
visitSourceDebugExtensionAttribute
in interfaceAttributeVisitor
-
visitInnerClassesAttribute
public void visitInnerClassesAttribute(Clazz clazz, InnerClassesAttribute innerClassesAttribute)
- Specified by:
visitInnerClassesAttribute
in interfaceAttributeVisitor
-
visitEnclosingMethodAttribute
public void visitEnclosingMethodAttribute(Clazz clazz, EnclosingMethodAttribute enclosingMethodAttribute)
- Specified by:
visitEnclosingMethodAttribute
in interfaceAttributeVisitor
-
visitNestHostAttribute
public void visitNestHostAttribute(Clazz clazz, NestHostAttribute nestHostAttribute)
- Specified by:
visitNestHostAttribute
in interfaceAttributeVisitor
-
visitNestMembersAttribute
public void visitNestMembersAttribute(Clazz clazz, NestMembersAttribute nestMembersAttribute)
- Specified by:
visitNestMembersAttribute
in interfaceAttributeVisitor
-
visitPermittedSubclassesAttribute
public void visitPermittedSubclassesAttribute(Clazz clazz, PermittedSubclassesAttribute permittedSubclassesAttribute)
- Specified by:
visitPermittedSubclassesAttribute
in interfaceAttributeVisitor
-
visitDeprecatedAttribute
public void visitDeprecatedAttribute(Clazz clazz, DeprecatedAttribute deprecatedAttribute)
- Specified by:
visitDeprecatedAttribute
in interfaceAttributeVisitor
-
visitSyntheticAttribute
public void visitSyntheticAttribute(Clazz clazz, SyntheticAttribute syntheticAttribute)
- Specified by:
visitSyntheticAttribute
in interfaceAttributeVisitor
-
visitSignatureAttribute
public void visitSignatureAttribute(Clazz clazz, SignatureAttribute signatureAttribute)
- Specified by:
visitSignatureAttribute
in interfaceAttributeVisitor
-
visitConstantValueAttribute
public void visitConstantValueAttribute(Clazz clazz, Field field, ConstantValueAttribute constantValueAttribute)
- Specified by:
visitConstantValueAttribute
in interfaceAttributeVisitor
-
visitMethodParametersAttribute
public void visitMethodParametersAttribute(Clazz clazz, Method method, MethodParametersAttribute methodParametersAttribute)
- Specified by:
visitMethodParametersAttribute
in interfaceAttributeVisitor
-
visitExceptionsAttribute
public void visitExceptionsAttribute(Clazz clazz, Method method, ExceptionsAttribute exceptionsAttribute)
- Specified by:
visitExceptionsAttribute
in interfaceAttributeVisitor
-
visitCodeAttribute
public void visitCodeAttribute(Clazz clazz, Method method, CodeAttribute codeAttribute)
- Specified by:
visitCodeAttribute
in interfaceAttributeVisitor
-
visitStackMapAttribute
public void visitStackMapAttribute(Clazz clazz, Method method, CodeAttribute codeAttribute, StackMapAttribute stackMapAttribute)
- Specified by:
visitStackMapAttribute
in interfaceAttributeVisitor
-
visitStackMapTableAttribute
public void visitStackMapTableAttribute(Clazz clazz, Method method, CodeAttribute codeAttribute, StackMapTableAttribute stackMapTableAttribute)
- Specified by:
visitStackMapTableAttribute
in interfaceAttributeVisitor
-
visitLineNumberTableAttribute
public void visitLineNumberTableAttribute(Clazz clazz, Method method, CodeAttribute codeAttribute, LineNumberTableAttribute lineNumberTableAttribute)
- Specified by:
visitLineNumberTableAttribute
in interfaceAttributeVisitor
-
visitLocalVariableTableAttribute
public void visitLocalVariableTableAttribute(Clazz clazz, Method method, CodeAttribute codeAttribute, LocalVariableTableAttribute localVariableTableAttribute)
- Specified by:
visitLocalVariableTableAttribute
in interfaceAttributeVisitor
-
visitLocalVariableTypeTableAttribute
public void visitLocalVariableTypeTableAttribute(Clazz clazz, Method method, CodeAttribute codeAttribute, LocalVariableTypeTableAttribute localVariableTypeTableAttribute)
- Specified by:
visitLocalVariableTypeTableAttribute
in interfaceAttributeVisitor
-
visitRuntimeVisibleAnnotationsAttribute
public void visitRuntimeVisibleAnnotationsAttribute(Clazz clazz, RuntimeVisibleAnnotationsAttribute runtimeVisibleAnnotationsAttribute)
- Specified by:
visitRuntimeVisibleAnnotationsAttribute
in interfaceAttributeVisitor
-
visitRuntimeInvisibleAnnotationsAttribute
public void visitRuntimeInvisibleAnnotationsAttribute(Clazz clazz, RuntimeInvisibleAnnotationsAttribute runtimeInvisibleAnnotationsAttribute)
- Specified by:
visitRuntimeInvisibleAnnotationsAttribute
in interfaceAttributeVisitor
-
visitRuntimeVisibleParameterAnnotationsAttribute
public void visitRuntimeVisibleParameterAnnotationsAttribute(Clazz clazz, Method method, RuntimeVisibleParameterAnnotationsAttribute runtimeVisibleParameterAnnotationsAttribute)
- Specified by:
visitRuntimeVisibleParameterAnnotationsAttribute
in interfaceAttributeVisitor
-
visitRuntimeInvisibleParameterAnnotationsAttribute
public void visitRuntimeInvisibleParameterAnnotationsAttribute(Clazz clazz, Method method, RuntimeInvisibleParameterAnnotationsAttribute runtimeInvisibleParameterAnnotationsAttribute)
- Specified by:
visitRuntimeInvisibleParameterAnnotationsAttribute
in interfaceAttributeVisitor
-
visitRuntimeVisibleTypeAnnotationsAttribute
public void visitRuntimeVisibleTypeAnnotationsAttribute(Clazz clazz, RuntimeVisibleTypeAnnotationsAttribute runtimeVisibleTypeAnnotationsAttribute)
- Specified by:
visitRuntimeVisibleTypeAnnotationsAttribute
in interfaceAttributeVisitor
-
visitRuntimeInvisibleTypeAnnotationsAttribute
public void visitRuntimeInvisibleTypeAnnotationsAttribute(Clazz clazz, RuntimeInvisibleTypeAnnotationsAttribute runtimeInvisibleTypeAnnotationsAttribute)
- Specified by:
visitRuntimeInvisibleTypeAnnotationsAttribute
in interfaceAttributeVisitor
-
visitAnnotationDefaultAttribute
public void visitAnnotationDefaultAttribute(Clazz clazz, Method method, AnnotationDefaultAttribute annotationDefaultAttribute)
- Specified by:
visitAnnotationDefaultAttribute
in interfaceAttributeVisitor
-
-