Package net.bytebuddy.pool
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.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionprotected class
An annotation extractor reads an annotation found in a class field an collects data that is relevant to creating a related annotation description.protected class
A field extractor reads a field within a class file and collects data that is relevant to creating a related field description.protected class
A method extractor reads a method within a class file and collects data that is relevant to creating a related method description.protected class
A record component extractor reads a record component's information within a class file. -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate int
The actual modifiers found for this type.private final List<TypePool.Default.LazyTypeDescription.AnnotationToken>
A list of annotation tokens describing annotations that are found on the visited type.private boolean
true
if this type was found to represent an anonymous type.private ClassFileVersion
The discovered class file version ornull
if no version was yet discovered.A list of descriptors representing the types that are declared by the parsed type.private String
The binary name of this type's declaring type ornull
if no such type exists.private final List<TypePool.Default.LazyTypeDescription.FieldToken>
A list of field tokens describing fields that are found on the visited type.private String
The generic signature of the type ornull
if it is not generic.private String[]
A list of internal names of interfaces implemented by this type ornull
if no interfaces are implemented.private String
The internal name found for this type.private final List<TypePool.Default.LazyTypeDescription.MethodToken>
A list of method tokens describing annotations that are found on the visited type.private int
The modifiers found for this type.private String
The nest host that was found in the class file ornull
if no nest host was specified.A list of nest members that were found in the class file.A list of internal names of permitted subclasses.private static final int
A mask that cuts off pseudo flags beyond the second byte that are inserted by ASM.private final List<TypePool.Default.LazyTypeDescription.RecordComponentToken>
A list of record component tokens that are found on the visited type.private static final int
The index of a super class's type annotations.private String
The internal name of the super type found for this type ornull
if no such type exists.A mapping of the super types' type annotation tokens by their indices.The declaration context found for this type.A mapping of the type variables' type annotation tokens by their indices.private final Map<Integer,
Map<Integer, Map<String, List<TypePool.Default.LazyTypeDescription.AnnotationToken>>>> A mapping of the type variables' bounds' type annotation tokens by their indices and each variables index.Fields inherited from class org.objectweb.asm.ClassVisitor
api, cv
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected TypeDescription
Creates a type description from all data that is currently collected.void
visit
(int classFileVersion, int modifiers, String internalName, String genericSignature, String superClassName, String[] interfaceName) org.objectweb.asm.AnnotationVisitor
visitAnnotation
(String descriptor, boolean visible) org.objectweb.asm.FieldVisitor
visitField
(int modifiers, String internalName, String descriptor, String genericSignature, Object value) void
visitInnerClass
(String internalName, String outerName, String innerName, int modifiers) org.objectweb.asm.MethodVisitor
visitMethod
(int modifiers, String internalName, String descriptor, String genericSignature, String[] exceptionName) void
visitNestHost
(String nestHost) void
visitNestMember
(String nestMember) void
visitOuterClass
(String typeName, String methodName, String methodDescriptor) void
visitPermittedSubclass
(String permittedSubclass) org.objectweb.asm.RecordComponentVisitor
visitRecordComponent
(String name, String descriptor, String signature) org.objectweb.asm.AnnotationVisitor
visitTypeAnnotation
(int rawTypeReference, org.objectweb.asm.TypePath typePath, String descriptor, boolean visible) Methods inherited from class org.objectweb.asm.ClassVisitor
visitAttribute, visitEnd, visitModule, visitSource
-
Field Details
-
SUPER_CLASS_INDEX
private static final int SUPER_CLASS_INDEXThe index of a super class's type annotations.- See Also:
-
REAL_MODIFIER_MASK
private static final int REAL_MODIFIER_MASKA mask that cuts off pseudo flags beyond the second byte that are inserted by ASM.- See Also:
-
superTypeAnnotationTokens
private final Map<Integer,Map<String, superTypeAnnotationTokensList<TypePool.Default.LazyTypeDescription.AnnotationToken>>> A mapping of the super types' type annotation tokens by their indices. -
typeVariableAnnotationTokens
private final Map<Integer,Map<String, typeVariableAnnotationTokensList<TypePool.Default.LazyTypeDescription.AnnotationToken>>> A mapping of the type variables' type annotation tokens by their indices. -
typeVariableBoundsAnnotationTokens
private final Map<Integer,Map<Integer, typeVariableBoundsAnnotationTokensMap<String, List<TypePool.Default.LazyTypeDescription.AnnotationToken>>>> 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 actualModifiersThe actual modifiers found for this type. -
modifiers
private int modifiersThe modifiers found for this type. -
internalName
The internal name found for this type. -
superClassName
The internal name of the super type found for this type ornull
if no such type exists. -
genericSignature
The generic signature of the type ornull
if it is not generic. -
interfaceName
A list of internal names of interfaces implemented by this type ornull
if no interfaces are implemented. -
anonymousType
private boolean anonymousTypetrue
if this type was found to represent an anonymous type. -
nestHost
The nest host that was found in the class file ornull
if no nest host was specified. -
nestMembers
A list of nest members that were found in the class file. -
typeContainment
The declaration context found for this type. -
declaringTypeName
The binary name of this type's declaring type ornull
if no such type exists. -
declaredTypes
A list of descriptors representing the types that are declared by the parsed type. -
permittedSubclasses
A list of internal names of permitted subclasses. -
classFileVersion
The discovered class file version ornull
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 classorg.objectweb.asm.ClassVisitor
-
visitOuterClass
public void visitOuterClass(@MaybeNull String typeName, @MaybeNull String methodName, String methodDescriptor) - Overrides:
visitOuterClass
in classorg.objectweb.asm.ClassVisitor
-
visitInnerClass
public void visitInnerClass(String internalName, @MaybeNull String outerName, @MaybeNull String innerName, int modifiers) - Overrides:
visitInnerClass
in classorg.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 classorg.objectweb.asm.ClassVisitor
-
visitAnnotation
- Overrides:
visitAnnotation
in classorg.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 classorg.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 classorg.objectweb.asm.ClassVisitor
-
visitNestHost
- Overrides:
visitNestHost
in classorg.objectweb.asm.ClassVisitor
-
visitNestMember
- Overrides:
visitNestMember
in classorg.objectweb.asm.ClassVisitor
-
visitRecordComponent
public org.objectweb.asm.RecordComponentVisitor visitRecordComponent(String name, String descriptor, @MaybeNull String signature) - Overrides:
visitRecordComponent
in classorg.objectweb.asm.ClassVisitor
-
visitPermittedSubclass
- Overrides:
visitPermittedSubclass
in classorg.objectweb.asm.ClassVisitor
-
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.
-