Package proguard.classfile.util
Class NestHostFinder
- java.lang.Object
-
- proguard.classfile.util.NestHostFinder
-
- All Implemented Interfaces:
AttributeVisitor
,ClassVisitor
public class NestHostFinder extends java.lang.Object implements ClassVisitor, AttributeVisitor
This utility class can find the nest host class names of given classes.
-
-
Constructor Summary
Constructors Constructor Description NestHostFinder()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.String
findNestHostClassName(Clazz clazz)
Returns the class name of the nest host of the given class.boolean
inSameNest(Clazz class1, Clazz class2)
Returns whether the two given classes are in the same nest.void
visitAnyAttribute(Clazz clazz, Attribute attribute)
Visits any Attribute instance.void
visitAnyClass(Clazz clazz)
Visits any Clazz instance.void
visitNestHostAttribute(Clazz clazz, NestHostAttribute nestHostAttribute)
void
visitProgramClass(ProgramClass programClass)
-
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
visitAnnotationDefaultAttribute, visitAnyAnnotationsAttribute, visitAnyParameterAnnotationsAttribute, visitAnyTypeAnnotationsAttribute, visitBootstrapMethodsAttribute, visitCodeAttribute, visitConstantValueAttribute, visitDeprecatedAttribute, visitDeprecatedAttribute, visitDeprecatedAttribute, visitDeprecatedAttribute, visitEnclosingMethodAttribute, visitExceptionsAttribute, visitInnerClassesAttribute, visitLineNumberTableAttribute, visitLocalVariableTableAttribute, visitLocalVariableTypeTableAttribute, visitMethodParametersAttribute, visitModuleAttribute, visitModuleMainClassAttribute, visitModulePackagesAttribute, 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, visitSignatureAttribute, visitSourceDebugExtensionAttribute, visitSourceDirAttribute, visitSourceFileAttribute, visitStackMapAttribute, visitStackMapTableAttribute, visitSyntheticAttribute, visitSyntheticAttribute, visitSyntheticAttribute, visitSyntheticAttribute, visitUnknownAttribute
-
Methods inherited from interface proguard.classfile.visitor.ClassVisitor
visitLibraryClass
-
-
-
-
Method Detail
-
inSameNest
public boolean inSameNest(Clazz class1, Clazz class2)
Returns whether the two given classes are in the same nest.
-
findNestHostClassName
public java.lang.String findNestHostClassName(Clazz clazz)
Returns the class name of the nest host of the given class. This may be the class itself, if the class doesn't have a nest host attribute (including for class versions below Java 11 and for library classes).
-
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
-
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
-
visitNestHostAttribute
public void visitNestHostAttribute(Clazz clazz, NestHostAttribute nestHostAttribute)
- Specified by:
visitNestHostAttribute
in interfaceAttributeVisitor
-
-