Class TypeReferenceAdjustment.TypeReferenceClassVisitor

java.lang.Object
org.objectweb.asm.ClassVisitor
net.bytebuddy.asm.TypeReferenceAdjustment.TypeReferenceClassVisitor
Enclosing class:
TypeReferenceAdjustment

protected static class TypeReferenceAdjustment.TypeReferenceClassVisitor extends org.objectweb.asm.ClassVisitor
A class visitor that collects all type references and all inner class references.
  • Field Details

    • IGNORE_ANNOTATION

      @AlwaysNull private static final org.objectweb.asm.AnnotationVisitor IGNORE_ANNOTATION
      Indicates that an annotation is not of interest.
    • IGNORE_FIELD

      @AlwaysNull private static final org.objectweb.asm.FieldVisitor IGNORE_FIELD
      Indicates that a field is not of interest.
    • IGNORE_METHOD

      @AlwaysNull private static final org.objectweb.asm.MethodVisitor IGNORE_METHOD
      Indicates that a method is not of interest.
    • strict

      private final boolean strict
      true if the visitor should throw an exception if a type reference cannot be located.
    • filter

      private final ElementMatcher<? super TypeDescription> filter
      A filter for excluding types from type reference analysis.
    • typePool

      private final TypePool typePool
      The type pool to use for locating types.
    • observedTypes

      private final Set<String> observedTypes
      A set of inner class names that have been observed within the processed class file.
    • visitedInnerTypes

      private final Set<String> visitedInnerTypes
      A set of inner class names that were added as inner class attribute values.
  • Constructor Details

    • TypeReferenceClassVisitor

      protected TypeReferenceClassVisitor(org.objectweb.asm.ClassVisitor classVisitor, boolean strict, ElementMatcher<? super TypeDescription> filter, TypePool typePool)
      Creates a type reference class visitor.
      Parameters:
      classVisitor - true if the visitor should throw an exception if a type reference cannot be located.
      strict - true if the visitor should throw an exception if a type reference cannot be located.
      filter - A filter for excluding types from type reference analysis.
      typePool - The type pool to use for locating types.
  • Method Details

    • visit

      public void visit(int version, int modifiers, String internalName, @MaybeNull String genericSignature, @MaybeNull String superClassInternalName, @MaybeNull String[] interfaceInternalName)
      Overrides:
      visit in class org.objectweb.asm.ClassVisitor
    • visitNestHost

      public void visitNestHost(String nestHost)
      Overrides:
      visitNestHost in class org.objectweb.asm.ClassVisitor
    • visitOuterClass

      public void visitOuterClass(String ownerTypeInternalName, String methodName, String methodDescriptor)
      Overrides:
      visitOuterClass in class org.objectweb.asm.ClassVisitor
    • visitNestMember

      public void visitNestMember(String nestMember)
      Overrides:
      visitNestMember in class org.objectweb.asm.ClassVisitor
    • visitInnerClass

      public void visitInnerClass(String internalName, String outerName, String innerName, int modifiers)
      Overrides:
      visitInnerClass in class org.objectweb.asm.ClassVisitor
    • visitRecordComponent

      @MaybeNull public org.objectweb.asm.RecordComponentVisitor visitRecordComponent(String name, String descriptor, @MaybeNull String signature)
      Overrides:
      visitRecordComponent in class org.objectweb.asm.ClassVisitor
    • visitAnnotation

      @MaybeNull public org.objectweb.asm.AnnotationVisitor visitAnnotation(String descriptor, boolean visible)
      Overrides:
      visitAnnotation in class org.objectweb.asm.ClassVisitor
    • visitTypeAnnotation

      @MaybeNull public org.objectweb.asm.AnnotationVisitor visitTypeAnnotation(int typeReference, @MaybeNull org.objectweb.asm.TypePath typePath, String descriptor, boolean visible)
      Overrides:
      visitTypeAnnotation in class org.objectweb.asm.ClassVisitor
    • visitField

      @MaybeNull public org.objectweb.asm.FieldVisitor visitField(int modifiers, String name, String descriptor, @MaybeNull String signature, @MaybeNull Object value)
      Overrides:
      visitField in class org.objectweb.asm.ClassVisitor
    • visitMethod

      @MaybeNull public org.objectweb.asm.MethodVisitor visitMethod(int modifiers, String internalName, String descriptor, @MaybeNull String signature, @MaybeNull String[] exceptionInternalName)
      Overrides:
      visitMethod in class org.objectweb.asm.ClassVisitor
    • visitEnd

      public void visitEnd()
      Overrides:
      visitEnd in class org.objectweb.asm.ClassVisitor
    • resolve

      protected void resolve(org.objectweb.asm.Type type)
      Resolves all type references that are referenced by a Type value.
      Parameters:
      type - The type to resolve.
    • resolve

      protected void resolve(org.objectweb.asm.Handle handle)
      Resolves all type references that are referenced by a Handle value.
      Parameters:
      handle - The handle to resolve.
    • resolve

      protected void resolve(org.objectweb.asm.ConstantDynamic constant)
      Resolves all type references that are referenced by a ConstantDynamic value.
      Parameters:
      constant - The dynamic constant to resolve.
    • observeInternalName

      private void observeInternalName(String internalName)
      Observes an internal name of an object type that might be an array type.
      Parameters:
      internalName - The internal name to resolve.
    • resolve

      protected void resolve(Object value)
      Resolves all type references that are referenced by any ASM constant value.
      Parameters:
      value - The unknown constant value to resolve.