Class NestHostFinder

java.lang.Object
proguard.classfile.util.NestHostFinder
All Implemented Interfaces:
AttributeVisitor, ClassVisitor

public class NestHostFinder extends Object implements ClassVisitor, AttributeVisitor
This utility class can find the nest host class names of given classes.
  • Constructor Details

    • NestHostFinder

      public NestHostFinder()
  • Method Details

    • inSameNest

      public boolean inSameNest(Clazz class1, Clazz class2)
      Returns whether the two given classes are in the same nest.
    • findNestHostClassName

      public 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 interface ClassVisitor
    • visitProgramClass

      public void visitProgramClass(ProgramClass programClass)
      Specified by:
      visitProgramClass in interface ClassVisitor
    • 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 interface AttributeVisitor
    • visitNestHostAttribute

      public void visitNestHostAttribute(Clazz clazz, NestHostAttribute nestHostAttribute)
      Specified by:
      visitNestHostAttribute in interface AttributeVisitor