Package proguard.classfile.visitor
Class ReferencedClassVisitor
- java.lang.Object
-
- proguard.classfile.visitor.ReferencedClassVisitor
-
- All Implemented Interfaces:
AnnotationVisitor
,ElementValueVisitor
,AttributeVisitor
,LocalVariableInfoVisitor
,LocalVariableTypeInfoVisitor
,ConstantVisitor
,ClassVisitor
,MemberVisitor
public class ReferencedClassVisitor extends java.lang.Object implements ClassVisitor, MemberVisitor, ConstantVisitor, AttributeVisitor, LocalVariableInfoVisitor, LocalVariableTypeInfoVisitor, AnnotationVisitor, ElementValueVisitor
ThisClassVisitor
,MemberVisitor
,ConstantVisitor
,AttributeVisitor
, etc. lets a givenClassVisitor
visit all the referenced classes of the elements that it visits. Only downstream elements are considered (in order to avoid loops and repeated visits)It also considers references in the Kotlin metadata of this class, if includeKotlinMetadata = true. So that, for example, a Kotlin function referencing a type alias will execute the delegate class visitor for the referencedClass of the alias.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
ReferencedClassVisitor.KotlinReferencedClassVisitor
-
Constructor Summary
Constructors Constructor Description ReferencedClassVisitor(boolean includeKotlinMetadata, ClassVisitor classVisitor)
ReferencedClassVisitor(ClassVisitor classVisitor)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
visitAnnotation(Clazz clazz, Annotation annotation)
Visits any Annotation instance.void
visitAnnotationDefaultAttribute(Clazz clazz, Method method, AnnotationDefaultAttribute annotationDefaultAttribute)
void
visitAnnotationElementValue(Clazz clazz, Annotation annotation, AnnotationElementValue annotationElementValue)
void
visitAnyAnnotationsAttribute(Clazz clazz, AnnotationsAttribute annotationsAttribute)
Visits any AnnotationsAttribute instance.void
visitAnyAttribute(Clazz clazz, Attribute attribute)
Visits any Attribute instance.void
visitAnyClass(Clazz clazz)
Visits any Clazz instance.void
visitAnyConstant(Clazz clazz, Constant constant)
Visits any Constant instance.void
visitAnyElementValue(Clazz clazz, Annotation annotation, ElementValue elementValue)
Visits any ElementValue instance.void
visitAnyParameterAnnotationsAttribute(Clazz clazz, Method method, ParameterAnnotationsAttribute parameterAnnotationsAttribute)
Visits any ParameterAnnotationsAttribute instance.void
visitAnyRefConstant(Clazz clazz, RefConstant refConstant)
Visits any RefConstant instance.void
visitArrayElementValue(Clazz clazz, Annotation annotation, ArrayElementValue arrayElementValue)
void
visitClassConstant(Clazz clazz, ClassConstant classConstant)
void
visitClassElementValue(Clazz clazz, Annotation annotation, ClassElementValue classElementValue)
void
visitCodeAttribute(Clazz clazz, Method method, CodeAttribute codeAttribute)
void
visitEnclosingMethodAttribute(Clazz clazz, EnclosingMethodAttribute enclosingMethodAttribute)
void
visitEnumConstantElementValue(Clazz clazz, Annotation annotation, EnumConstantElementValue enumConstantElementValue)
void
visitInvokeDynamicConstant(Clazz clazz, InvokeDynamicConstant invokeDynamicConstant)
void
visitLibraryClass(LibraryClass libraryClass)
void
visitLibraryMember(LibraryClass programClass, LibraryMember libraryMember)
void
visitLocalVariableInfo(Clazz clazz, Method method, CodeAttribute codeAttribute, LocalVariableInfo localVariableInfo)
void
visitLocalVariableTableAttribute(Clazz clazz, Method method, CodeAttribute codeAttribute, LocalVariableTableAttribute localVariableTableAttribute)
void
visitLocalVariableTypeInfo(Clazz clazz, Method method, CodeAttribute codeAttribute, LocalVariableTypeInfo localVariableTypeInfo)
void
visitLocalVariableTypeTableAttribute(Clazz clazz, Method method, CodeAttribute codeAttribute, LocalVariableTypeTableAttribute localVariableTypeTableAttribute)
void
visitMethodTypeConstant(Clazz clazz, MethodTypeConstant methodTypeConstant)
void
visitProgramClass(ProgramClass programClass)
void
visitProgramMember(ProgramClass programClass, ProgramMember programMember)
void
visitSignatureAttribute(Clazz clazz, SignatureAttribute signatureAttribute)
void
visitStringConstant(Clazz clazz, StringConstant stringConstant)
-
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, visitBootstrapMethodsAttribute, visitConstantValueAttribute, visitDeprecatedAttribute, visitDeprecatedAttribute, visitDeprecatedAttribute, visitDeprecatedAttribute, visitExceptionsAttribute, visitInnerClassesAttribute, visitLineNumberTableAttribute, visitMethodParametersAttribute, visitModuleAttribute, visitModuleMainClassAttribute, visitModulePackagesAttribute, visitNestHostAttribute, visitNestMembersAttribute, visitPermittedSubclassesAttribute, visitRecordAttribute, 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, visitSourceDirAttribute, visitSourceFileAttribute, visitStackMapAttribute, visitStackMapTableAttribute, visitSyntheticAttribute, visitSyntheticAttribute, visitSyntheticAttribute, visitSyntheticAttribute, visitUnknownAttribute
-
Methods inherited from interface proguard.classfile.constant.visitor.ConstantVisitor
visitAnyMethodrefConstant, visitDoubleConstant, visitDynamicConstant, visitFieldrefConstant, visitFloatConstant, visitIntegerConstant, visitInterfaceMethodrefConstant, visitLongConstant, visitMethodHandleConstant, visitMethodrefConstant, visitModuleConstant, visitNameAndTypeConstant, visitPackageConstant, visitPrimitiveArrayConstant, visitUtf8Constant
-
Methods inherited from interface proguard.classfile.attribute.annotation.visitor.ElementValueVisitor
visitConstantElementValue
-
Methods inherited from interface proguard.classfile.visitor.MemberVisitor
visitAnyMember, visitLibraryField, visitLibraryMethod, visitProgramField, visitProgramMethod
-
-
-
-
Constructor Detail
-
ReferencedClassVisitor
public ReferencedClassVisitor(ClassVisitor classVisitor)
-
ReferencedClassVisitor
public ReferencedClassVisitor(boolean includeKotlinMetadata, ClassVisitor classVisitor)
-
-
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
-
visitLibraryClass
public void visitLibraryClass(LibraryClass libraryClass)
- Specified by:
visitLibraryClass
in interfaceClassVisitor
-
visitProgramMember
public void visitProgramMember(ProgramClass programClass, ProgramMember programMember)
- Specified by:
visitProgramMember
in interfaceMemberVisitor
-
visitLibraryMember
public void visitLibraryMember(LibraryClass programClass, LibraryMember libraryMember)
- Specified by:
visitLibraryMember
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
-
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
-
visitInvokeDynamicConstant
public void visitInvokeDynamicConstant(Clazz clazz, InvokeDynamicConstant invokeDynamicConstant)
- Specified by:
visitInvokeDynamicConstant
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
-
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
-
visitEnclosingMethodAttribute
public void visitEnclosingMethodAttribute(Clazz clazz, EnclosingMethodAttribute enclosingMethodAttribute)
- Specified by:
visitEnclosingMethodAttribute
in interfaceAttributeVisitor
-
visitCodeAttribute
public void visitCodeAttribute(Clazz clazz, Method method, CodeAttribute codeAttribute)
- Specified by:
visitCodeAttribute
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
-
visitSignatureAttribute
public void visitSignatureAttribute(Clazz clazz, SignatureAttribute signatureAttribute)
- Specified by:
visitSignatureAttribute
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
-
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
-
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
-
visitAnyElementValue
public void visitAnyElementValue(Clazz clazz, Annotation annotation, ElementValue elementValue)
Description copied from interface:ElementValueVisitor
Visits any ElementValue instance. The more specific default implementations of this interface delegate to this method.- Specified by:
visitAnyElementValue
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
-
-