Package proguard.classfile.editor
Class ConstantPoolShrinker
- java.lang.Object
-
- proguard.classfile.editor.ConstantPoolShrinker
-
- All Implemented Interfaces:
AnnotationVisitor
,ElementValueVisitor
,ExportsInfoVisitor
,OpensInfoVisitor
,ProvidesInfoVisitor
,RequiresInfoVisitor
,StackMapFrameVisitor
,VerificationTypeVisitor
,AttributeVisitor
,BootstrapMethodInfoVisitor
,ExceptionInfoVisitor
,InnerClassesInfoVisitor
,LocalVariableInfoVisitor
,LocalVariableTypeInfoVisitor
,ParameterInfoVisitor
,RecordComponentInfoVisitor
,ConstantVisitor
,InstructionVisitor
,ClassVisitor
,MemberVisitor
public class ConstantPoolShrinker extends java.lang.Object implements ClassVisitor, MemberVisitor, ConstantVisitor, AttributeVisitor, BootstrapMethodInfoVisitor, RecordComponentInfoVisitor, InnerClassesInfoVisitor, ExceptionInfoVisitor, StackMapFrameVisitor, VerificationTypeVisitor, ParameterInfoVisitor, LocalVariableInfoVisitor, LocalVariableTypeInfoVisitor, RequiresInfoVisitor, ExportsInfoVisitor, OpensInfoVisitor, ProvidesInfoVisitor, AnnotationVisitor, ElementValueVisitor, InstructionVisitor
ThisClassVisitor
removes all unused entries from the constant pool.
-
-
Constructor Summary
Constructors Constructor Description ConstantPoolShrinker()
-
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.annotation.visitor.AnnotationVisitor
visitAnnotation, visitAnnotation, visitAnnotation, visitAnnotation, visitAnnotation
-
Methods inherited from interface proguard.classfile.attribute.visitor.AttributeVisitor
visitAnyTypeAnnotationsAttribute, visitDeprecatedAttribute, visitDeprecatedAttribute, visitDeprecatedAttribute, visitDeprecatedAttribute, visitLineNumberTableAttribute, visitRuntimeInvisibleAnnotationsAttribute, visitRuntimeInvisibleAnnotationsAttribute, visitRuntimeInvisibleAnnotationsAttribute, visitRuntimeInvisibleAnnotationsAttribute, visitRuntimeInvisibleAnnotationsAttribute, visitRuntimeInvisibleParameterAnnotationsAttribute, visitRuntimeInvisibleTypeAnnotationsAttribute, visitRuntimeInvisibleTypeAnnotationsAttribute, visitRuntimeInvisibleTypeAnnotationsAttribute, visitRuntimeInvisibleTypeAnnotationsAttribute, visitRuntimeInvisibleTypeAnnotationsAttribute, visitRuntimeInvisibleTypeAnnotationsAttribute, visitRuntimeVisibleAnnotationsAttribute, visitRuntimeVisibleAnnotationsAttribute, visitRuntimeVisibleAnnotationsAttribute, visitRuntimeVisibleAnnotationsAttribute, visitRuntimeVisibleAnnotationsAttribute, visitRuntimeVisibleParameterAnnotationsAttribute, visitRuntimeVisibleTypeAnnotationsAttribute, visitRuntimeVisibleTypeAnnotationsAttribute, visitRuntimeVisibleTypeAnnotationsAttribute, visitRuntimeVisibleTypeAnnotationsAttribute, visitRuntimeVisibleTypeAnnotationsAttribute, visitRuntimeVisibleTypeAnnotationsAttribute, visitSignatureAttribute, visitSignatureAttribute, visitSignatureAttribute, visitSignatureAttribute, visitSourceDebugExtensionAttribute, visitSyntheticAttribute, visitSyntheticAttribute, visitSyntheticAttribute, visitSyntheticAttribute, visitUnknownAttribute
-
Methods inherited from interface proguard.classfile.visitor.ClassVisitor
visitLibraryClass
-
Methods inherited from interface proguard.classfile.constant.visitor.ConstantVisitor
visitAnyMethodrefConstant, visitDoubleConstant, visitFieldrefConstant, visitFloatConstant, visitIntegerConstant, visitInterfaceMethodrefConstant, visitLongConstant, visitMethodrefConstant, visitPrimitiveArrayConstant, visitUtf8Constant
-
Methods inherited from interface proguard.classfile.attribute.annotation.visitor.ElementValueVisitor
visitAnyElementValue
-
Methods inherited from interface proguard.classfile.instruction.visitor.InstructionVisitor
visitAnySwitchInstruction, visitBranchInstruction, visitLookUpSwitchInstruction, visitSimpleInstruction, visitTableSwitchInstruction, visitVariableInstruction
-
Methods inherited from interface proguard.classfile.visitor.MemberVisitor
visitAnyMember, visitLibraryField, visitLibraryMember, visitLibraryMethod, visitProgramField, visitProgramMethod
-
Methods inherited from interface proguard.classfile.attribute.preverification.visitor.StackMapFrameVisitor
visitLessZeroFrame, visitSameZeroFrame
-
Methods inherited from interface proguard.classfile.attribute.preverification.visitor.VerificationTypeVisitor
visitDoubleType, visitFloatType, visitIntegerType, visitLongType, visitNullType, visitStackDoubleType, visitStackFloatType, visitStackIntegerType, visitStackLongType, visitStackNullType, visitStackObjectType, visitStackTopType, visitStackUninitializedThisType, visitStackUninitializedType, visitTopType, visitUninitializedThisType, visitUninitializedType, visitVariablesDoubleType, visitVariablesFloatType, visitVariablesIntegerType, visitVariablesLongType, visitVariablesNullType, visitVariablesObjectType, visitVariablesTopType, visitVariablesUninitializedThisType, visitVariablesUninitializedType
-
-
-
-
Method Detail
-
visitAnyClass
public void visitAnyClass(Clazz clazz)
Description copied from interface:ClassVisitor
Visits any Clazz instance. The more specific default implementations of this interface delegate to this method.- Specified by:
visitAnyClass
in interfaceClassVisitor
-
visitProgramClass
public void visitProgramClass(ProgramClass programClass)
- Specified by:
visitProgramClass
in interfaceClassVisitor
-
visitProgramMember
public void visitProgramMember(ProgramClass programClass, ProgramMember programMember)
- Specified by:
visitProgramMember
in interfaceMemberVisitor
-
visitAnyConstant
public void visitAnyConstant(Clazz clazz, Constant constant)
Description copied from interface:ConstantVisitor
Visits any Constant instance. The more specific default implementations of this interface delegate to this method.- Specified by:
visitAnyConstant
in interfaceConstantVisitor
-
visitStringConstant
public void visitStringConstant(Clazz clazz, StringConstant stringConstant)
- Specified by:
visitStringConstant
in interfaceConstantVisitor
-
visitDynamicConstant
public void visitDynamicConstant(Clazz clazz, DynamicConstant dynamicConstant)
- Specified by:
visitDynamicConstant
in interfaceConstantVisitor
-
visitInvokeDynamicConstant
public void visitInvokeDynamicConstant(Clazz clazz, InvokeDynamicConstant invokeDynamicConstant)
- Specified by:
visitInvokeDynamicConstant
in interfaceConstantVisitor
-
visitMethodHandleConstant
public void visitMethodHandleConstant(Clazz clazz, MethodHandleConstant methodHandleConstant)
- Specified by:
visitMethodHandleConstant
in interfaceConstantVisitor
-
visitAnyRefConstant
public void visitAnyRefConstant(Clazz clazz, RefConstant refConstant)
Description copied from interface:ConstantVisitor
Visits any RefConstant instance. The more specific default implementations of this interface delegate to this method.- Specified by:
visitAnyRefConstant
in interfaceConstantVisitor
-
visitClassConstant
public void visitClassConstant(Clazz clazz, ClassConstant classConstant)
- Specified by:
visitClassConstant
in interfaceConstantVisitor
-
visitMethodTypeConstant
public void visitMethodTypeConstant(Clazz clazz, MethodTypeConstant methodTypeConstant)
- Specified by:
visitMethodTypeConstant
in interfaceConstantVisitor
-
visitNameAndTypeConstant
public void visitNameAndTypeConstant(Clazz clazz, NameAndTypeConstant nameAndTypeConstant)
- Specified by:
visitNameAndTypeConstant
in interfaceConstantVisitor
-
visitModuleConstant
public void visitModuleConstant(Clazz clazz, ModuleConstant moduleConstant)
- Specified by:
visitModuleConstant
in interfaceConstantVisitor
-
visitPackageConstant
public void visitPackageConstant(Clazz clazz, PackageConstant packageConstant)
- Specified by:
visitPackageConstant
in interfaceConstantVisitor
-
visitAnyAttribute
public void visitAnyAttribute(Clazz clazz, Attribute attribute)
Description copied from interface:AttributeVisitor
Visits any Attribute instance. The more specific default implementations of this interface delegate to this method.- Specified by:
visitAnyAttribute
in interfaceAttributeVisitor
-
visitBootstrapMethodsAttribute
public void visitBootstrapMethodsAttribute(Clazz clazz, BootstrapMethodsAttribute bootstrapMethodsAttribute)
- Specified by:
visitBootstrapMethodsAttribute
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
-
visitRecordAttribute
public void visitRecordAttribute(Clazz clazz, RecordAttribute recordAttribute)
- Specified by:
visitRecordAttribute
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
-
visitModuleAttribute
public void visitModuleAttribute(Clazz clazz, ModuleAttribute moduleAttribute)
- Specified by:
visitModuleAttribute
in interfaceAttributeVisitor
-
visitModuleMainClassAttribute
public void visitModuleMainClassAttribute(Clazz clazz, ModuleMainClassAttribute moduleMainClassAttribute)
- Specified by:
visitModuleMainClassAttribute
in interfaceAttributeVisitor
-
visitModulePackagesAttribute
public void visitModulePackagesAttribute(Clazz clazz, ModulePackagesAttribute modulePackagesAttribute)
- Specified by:
visitModulePackagesAttribute
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
-
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
-
visitAnyAnnotationsAttribute
public void visitAnyAnnotationsAttribute(Clazz clazz, AnnotationsAttribute annotationsAttribute)
Description copied from interface:AttributeVisitor
Visits any AnnotationsAttribute instance. The more specific default implementations of this interface delegate to this method.- Specified by:
visitAnyAnnotationsAttribute
in interfaceAttributeVisitor
-
visitAnyParameterAnnotationsAttribute
public void visitAnyParameterAnnotationsAttribute(Clazz clazz, Method method, ParameterAnnotationsAttribute parameterAnnotationsAttribute)
Description copied from interface:AttributeVisitor
Visits any ParameterAnnotationsAttribute instance. The more specific default implementations of this interface delegate to this method.- Specified by:
visitAnyParameterAnnotationsAttribute
in interfaceAttributeVisitor
-
visitAnnotationDefaultAttribute
public void visitAnnotationDefaultAttribute(Clazz clazz, Method method, AnnotationDefaultAttribute annotationDefaultAttribute)
- Specified by:
visitAnnotationDefaultAttribute
in interfaceAttributeVisitor
-
visitBootstrapMethodInfo
public void visitBootstrapMethodInfo(Clazz clazz, BootstrapMethodInfo bootstrapMethodInfo)
- Specified by:
visitBootstrapMethodInfo
in interfaceBootstrapMethodInfoVisitor
-
visitRecordComponentInfo
public void visitRecordComponentInfo(Clazz clazz, RecordComponentInfo recordComponentInfo)
- Specified by:
visitRecordComponentInfo
in interfaceRecordComponentInfoVisitor
-
visitInnerClassesInfo
public void visitInnerClassesInfo(Clazz clazz, InnerClassesInfo innerClassesInfo)
- Specified by:
visitInnerClassesInfo
in interfaceInnerClassesInfoVisitor
-
visitExceptionInfo
public void visitExceptionInfo(Clazz clazz, Method method, CodeAttribute codeAttribute, ExceptionInfo exceptionInfo)
- Specified by:
visitExceptionInfo
in interfaceExceptionInfoVisitor
-
visitAnyStackMapFrame
public void visitAnyStackMapFrame(Clazz clazz, Method method, CodeAttribute codeAttribute, int offset, StackMapFrame stackMapFrame)
Description copied from interface:StackMapFrameVisitor
Visits any StackMapFrame instance. The more specific default implementations of this interface delegate to this method.- Specified by:
visitAnyStackMapFrame
in interfaceStackMapFrameVisitor
-
visitSameOneFrame
public void visitSameOneFrame(Clazz clazz, Method method, CodeAttribute codeAttribute, int offset, SameOneFrame sameOneFrame)
- Specified by:
visitSameOneFrame
in interfaceStackMapFrameVisitor
-
visitMoreZeroFrame
public void visitMoreZeroFrame(Clazz clazz, Method method, CodeAttribute codeAttribute, int offset, MoreZeroFrame moreZeroFrame)
- Specified by:
visitMoreZeroFrame
in interfaceStackMapFrameVisitor
-
visitFullFrame
public void visitFullFrame(Clazz clazz, Method method, CodeAttribute codeAttribute, int offset, FullFrame fullFrame)
- Specified by:
visitFullFrame
in interfaceStackMapFrameVisitor
-
visitAnyVerificationType
public void visitAnyVerificationType(Clazz clazz, Method method, CodeAttribute codeAttribute, int offset, VerificationType verificationType)
Description copied from interface:VerificationTypeVisitor
Visits any VerificationType instance. The more specific default implementations of this interface delegate to this method.- Specified by:
visitAnyVerificationType
in interfaceVerificationTypeVisitor
-
visitObjectType
public void visitObjectType(Clazz clazz, Method method, CodeAttribute codeAttribute, int offset, ObjectType objectType)
- Specified by:
visitObjectType
in interfaceVerificationTypeVisitor
-
visitParameterInfo
public void visitParameterInfo(Clazz clazz, Method method, int parameterIndex, ParameterInfo parameterInfo)
- Specified by:
visitParameterInfo
in interfaceParameterInfoVisitor
-
visitLocalVariableInfo
public void visitLocalVariableInfo(Clazz clazz, Method method, CodeAttribute codeAttribute, LocalVariableInfo localVariableInfo)
- Specified by:
visitLocalVariableInfo
in interfaceLocalVariableInfoVisitor
-
visitLocalVariableTypeInfo
public void visitLocalVariableTypeInfo(Clazz clazz, Method method, CodeAttribute codeAttribute, LocalVariableTypeInfo localVariableTypeInfo)
- Specified by:
visitLocalVariableTypeInfo
in interfaceLocalVariableTypeInfoVisitor
-
visitRequiresInfo
public void visitRequiresInfo(Clazz clazz, RequiresInfo requiresInfo)
- Specified by:
visitRequiresInfo
in interfaceRequiresInfoVisitor
-
visitExportsInfo
public void visitExportsInfo(Clazz clazz, ExportsInfo exportsInfo)
- Specified by:
visitExportsInfo
in interfaceExportsInfoVisitor
-
visitOpensInfo
public void visitOpensInfo(Clazz clazz, OpensInfo opensInfo)
- Specified by:
visitOpensInfo
in interfaceOpensInfoVisitor
-
visitProvidesInfo
public void visitProvidesInfo(Clazz clazz, ProvidesInfo providesInfo)
- Specified by:
visitProvidesInfo
in interfaceProvidesInfoVisitor
-
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
-
visitConstantElementValue
public void visitConstantElementValue(Clazz clazz, Annotation annotation, ConstantElementValue constantElementValue)
- Specified by:
visitConstantElementValue
in interfaceElementValueVisitor
-
visitEnumConstantElementValue
public void visitEnumConstantElementValue(Clazz clazz, Annotation annotation, EnumConstantElementValue enumConstantElementValue)
- Specified by:
visitEnumConstantElementValue
in interfaceElementValueVisitor
-
visitClassElementValue
public void visitClassElementValue(Clazz clazz, Annotation annotation, ClassElementValue classElementValue)
- Specified by:
visitClassElementValue
in interfaceElementValueVisitor
-
visitAnnotationElementValue
public void visitAnnotationElementValue(Clazz clazz, Annotation annotation, AnnotationElementValue annotationElementValue)
- Specified by:
visitAnnotationElementValue
in interfaceElementValueVisitor
-
visitArrayElementValue
public void visitArrayElementValue(Clazz clazz, Annotation annotation, ArrayElementValue arrayElementValue)
- Specified by:
visitArrayElementValue
in interfaceElementValueVisitor
-
visitAnyInstruction
public void visitAnyInstruction(Clazz clazz, Method method, CodeAttribute codeAttribute, int offset, Instruction instruction)
Description copied from interface:InstructionVisitor
Visits any Instruction instance. The more specific default implementations of this interface delegate to this method.- Specified by:
visitAnyInstruction
in interfaceInstructionVisitor
-
visitConstantInstruction
public void visitConstantInstruction(Clazz clazz, Method method, CodeAttribute codeAttribute, int offset, ConstantInstruction constantInstruction)
- Specified by:
visitConstantInstruction
in interfaceInstructionVisitor
-
-