Class TypePool.Default.TypeExtractor

java.lang.Object
org.objectweb.asm.ClassVisitor
net.bytebuddy.pool.TypePool.Default.TypeExtractor
Enclosing class:
TypePool.Default

protected class TypePool.Default.TypeExtractor extends org.objectweb.asm.ClassVisitor
A type extractor reads a class file and collects data that is relevant to create a type description.
  • Field Details

    • SUPER_CLASS_INDEX

      private static final int SUPER_CLASS_INDEX
      The index of a super class's type annotations.
      See Also:
    • REAL_MODIFIER_MASK

      private static final int REAL_MODIFIER_MASK
      A mask that cuts off pseudo flags beyond the second byte that are inserted by ASM.
      See Also:
    • superTypeAnnotationTokens

      private final Map<Integer,Map<String,List<TypePool.Default.LazyTypeDescription.AnnotationToken>>> superTypeAnnotationTokens
      A mapping of the super types' type annotation tokens by their indices.
    • typeVariableAnnotationTokens

      private final Map<Integer,Map<String,List<TypePool.Default.LazyTypeDescription.AnnotationToken>>> typeVariableAnnotationTokens
      A mapping of the type variables' type annotation tokens by their indices.
    • typeVariableBoundsAnnotationTokens

      private final Map<Integer,Map<Integer,Map<String,List<TypePool.Default.LazyTypeDescription.AnnotationToken>>>> typeVariableBoundsAnnotationTokens
      A mapping of the type variables' bounds' type annotation tokens by their indices and each variables index.
    • annotationTokens

      A list of annotation tokens describing annotations that are found on the visited type.
    • fieldTokens

      A list of field tokens describing fields that are found on the visited type.
    • methodTokens

      A list of method tokens describing annotations that are found on the visited type.
    • recordComponentTokens

      A list of record component tokens that are found on the visited type.
    • actualModifiers

      private int actualModifiers
      The actual modifiers found for this type.
    • modifiers

      private int modifiers
      The modifiers found for this type.
    • internalName

      @MaybeNull private String internalName
      The internal name found for this type.
    • superClassName

      @MaybeNull private String superClassName
      The internal name of the super type found for this type or null if no such type exists.
    • genericSignature

      @MaybeNull private String genericSignature
      The generic signature of the type or null if it is not generic.
    • interfaceName

      @MaybeNull private String[] interfaceName
      A list of internal names of interfaces implemented by this type or null if no interfaces are implemented.
    • anonymousType

      private boolean anonymousType
      true if this type was found to represent an anonymous type.
    • nestHost

      @MaybeNull private String nestHost
      The nest host that was found in the class file or null if no nest host was specified.
    • nestMembers

      private final List<String> nestMembers
      A list of nest members that were found in the class file.
    • typeContainment

      The declaration context found for this type.
    • declaringTypeName

      @MaybeNull private String declaringTypeName
      The binary name of this type's declaring type or null if no such type exists.
    • declaredTypes

      private final List<String> declaredTypes
      A list of descriptors representing the types that are declared by the parsed type.
    • permittedSubclasses

      private final List<String> permittedSubclasses
      A list of internal names of permitted subclasses.
    • classFileVersion

      @MaybeNull private ClassFileVersion classFileVersion
      The discovered class file version or null if no version was yet discovered.
  • Constructor Details

    • TypeExtractor

      protected TypeExtractor()
      Creates a new type extractor.
  • Method Details

    • visit

      public void visit(int classFileVersion, int modifiers, String internalName, @MaybeNull String genericSignature, @MaybeNull String superClassName, @MaybeNull String[] interfaceName)
      Overrides:
      visit in class org.objectweb.asm.ClassVisitor
    • visitOuterClass

      public void visitOuterClass(@MaybeNull String typeName, @MaybeNull String methodName, String methodDescriptor)
      Overrides:
      visitOuterClass in class org.objectweb.asm.ClassVisitor
    • visitInnerClass

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

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

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

      public org.objectweb.asm.FieldVisitor visitField(int modifiers, String internalName, String descriptor, @MaybeNull String genericSignature, @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 genericSignature, @MaybeNull String[] exceptionName)
      Overrides:
      visitMethod in class org.objectweb.asm.ClassVisitor
    • visitNestHost

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

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

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

      public void visitPermittedSubclass(String permittedSubclass)
      Overrides:
      visitPermittedSubclass in class org.objectweb.asm.ClassVisitor
    • toTypeDescription

      protected TypeDescription toTypeDescription()
      Creates a type description from all data that is currently collected. This method should only be invoked after a class file was parsed fully.
      Returns:
      A type description reflecting the data that was collected by this instance.