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 Classes Modifier and Type Class Description protected class
TypePool.Default.TypeExtractor.AnnotationExtractor
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
TypePool.Default.TypeExtractor.FieldExtractor
A field extractor reads a field within a class file and collects data that is relevant to creating a related field description.protected class
TypePool.Default.TypeExtractor.MethodExtractor
A method extractor reads a method within a class file and collects data that is relevant to creating a related method description.protected class
TypePool.Default.TypeExtractor.RecordComponentExtractor
A record component extractor reads a record component's information within a class file.
-
Field Summary
Fields Modifier and Type Field Description private int
actualModifiers
The actual modifiers found for this type.private java.util.List<TypePool.Default.LazyTypeDescription.AnnotationToken>
annotationTokens
A list of annotation tokens describing annotations that are found on the visited type.private boolean
anonymousType
true
if this type was found to represent an anonymous type.private java.util.List<java.lang.String>
declaredTypes
A list of descriptors representing the types that are declared by the parsed type.private java.lang.String
declaringTypeName
The binary name of this type's declaring type ornull
if no such type exists.private java.util.List<TypePool.Default.LazyTypeDescription.FieldToken>
fieldTokens
A list of field tokens describing fields that are found on the visited type.private java.lang.String
genericSignature
The generic signature of the type ornull
if it is not generic.private java.lang.String[]
interfaceName
A list of internal names of interfaces implemented by this type ornull
if no interfaces are implemented.private java.lang.String
internalName
The internal name found for this type.private java.util.List<TypePool.Default.LazyTypeDescription.MethodToken>
methodTokens
A list of method tokens describing annotations that are found on the visited type.private int
modifiers
The modifiers found for this type.private java.lang.String
nestHost
The nest host that was found in the class file ornull
if no nest host was specified.private java.util.List<java.lang.String>
nestMembers
A list of nest members that were found in the class file.private java.util.List<java.lang.String>
permittedSubclasses
A list of internal names of permitted subclasses.private static int
REAL_MODIFIER_MASK
A mask that cuts off pseudo flags beyond the second byte that are inserted by ASM.private java.util.List<TypePool.Default.LazyTypeDescription.RecordComponentToken>
recordComponentTokens
A list of record component tokens that are found on the visited type.private java.lang.String
superClassName
The internal name of the super type found for this type ornull
if no such type exists.private java.util.Map<java.lang.Integer,java.util.Map<java.lang.String,java.util.List<TypePool.Default.LazyTypeDescription.AnnotationToken>>>
superTypeAnnotationTokens
A mapping of the super types' type annotation tokens by their indices.private TypePool.Default.LazyTypeDescription.TypeContainment
typeContainment
The declaration context found for this type.private java.util.Map<java.lang.Integer,java.util.Map<java.lang.String,java.util.List<TypePool.Default.LazyTypeDescription.AnnotationToken>>>
typeVariableAnnotationTokens
A mapping of the type variables' type annotation tokens by their indices.private java.util.Map<java.lang.Integer,java.util.Map<java.lang.Integer,java.util.Map<java.lang.String,java.util.List<TypePool.Default.LazyTypeDescription.AnnotationToken>>>>
typeVariableBoundsAnnotationTokens
A mapping of the type variables' bounds' type annotation tokens by their indices and each variables index.
-
Constructor Summary
Constructors Modifier Constructor Description protected
TypeExtractor()
Creates a new type extractor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected TypeDescription
toTypeDescription()
Creates a type description from all data that is currently collected.void
visit(int classFileVersion, int modifiers, java.lang.String internalName, java.lang.String genericSignature, java.lang.String superClassName, java.lang.String[] interfaceName)
org.objectweb.asm.AnnotationVisitor
visitAnnotation(java.lang.String descriptor, boolean visible)
org.objectweb.asm.FieldVisitor
visitField(int modifiers, java.lang.String internalName, java.lang.String descriptor, java.lang.String genericSignature, java.lang.Object defaultValue)
void
visitInnerClass(java.lang.String internalName, java.lang.String outerName, java.lang.String innerName, int modifiers)
org.objectweb.asm.MethodVisitor
visitMethod(int modifiers, java.lang.String internalName, java.lang.String descriptor, java.lang.String genericSignature, java.lang.String[] exceptionName)
void
visitNestHost(java.lang.String nestHost)
void
visitNestMember(java.lang.String nestMember)
void
visitOuterClass(java.lang.String typeName, java.lang.String methodName, java.lang.String methodDescriptor)
void
visitPermittedSubclass(java.lang.String permittedSubclass)
org.objectweb.asm.RecordComponentVisitor
visitRecordComponent(java.lang.String name, java.lang.String descriptor, java.lang.String signature)
org.objectweb.asm.AnnotationVisitor
visitTypeAnnotation(int rawTypeReference, org.objectweb.asm.TypePath typePath, java.lang.String descriptor, boolean visible)
-
-
-
Field Detail
-
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:
- Constant Field Values
-
superTypeAnnotationTokens
private final java.util.Map<java.lang.Integer,java.util.Map<java.lang.String,java.util.List<TypePool.Default.LazyTypeDescription.AnnotationToken>>> superTypeAnnotationTokens
A mapping of the super types' type annotation tokens by their indices.
-
typeVariableAnnotationTokens
private final java.util.Map<java.lang.Integer,java.util.Map<java.lang.String,java.util.List<TypePool.Default.LazyTypeDescription.AnnotationToken>>> typeVariableAnnotationTokens
A mapping of the type variables' type annotation tokens by their indices.
-
typeVariableBoundsAnnotationTokens
private final java.util.Map<java.lang.Integer,java.util.Map<java.lang.Integer,java.util.Map<java.lang.String,java.util.List<TypePool.Default.LazyTypeDescription.AnnotationToken>>>> typeVariableBoundsAnnotationTokens
A mapping of the type variables' bounds' type annotation tokens by their indices and each variables index.
-
annotationTokens
private final java.util.List<TypePool.Default.LazyTypeDescription.AnnotationToken> annotationTokens
A list of annotation tokens describing annotations that are found on the visited type.
-
fieldTokens
private final java.util.List<TypePool.Default.LazyTypeDescription.FieldToken> fieldTokens
A list of field tokens describing fields that are found on the visited type.
-
methodTokens
private final java.util.List<TypePool.Default.LazyTypeDescription.MethodToken> methodTokens
A list of method tokens describing annotations that are found on the visited type.
-
recordComponentTokens
private final java.util.List<TypePool.Default.LazyTypeDescription.RecordComponentToken> 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
private java.lang.String internalName
The internal name found for this type.
-
superClassName
private java.lang.String superClassName
The internal name of the super type found for this type ornull
if no such type exists.
-
genericSignature
private java.lang.String genericSignature
The generic signature of the type ornull
if it is not generic.
-
interfaceName
private java.lang.String[] interfaceName
A list of internal names of interfaces implemented by this type ornull
if no interfaces are implemented.
-
anonymousType
private boolean anonymousType
true
if this type was found to represent an anonymous type.
-
nestHost
private java.lang.String nestHost
The nest host that was found in the class file ornull
if no nest host was specified.
-
nestMembers
private final java.util.List<java.lang.String> nestMembers
A list of nest members that were found in the class file.
-
typeContainment
private TypePool.Default.LazyTypeDescription.TypeContainment typeContainment
The declaration context found for this type.
-
declaringTypeName
private java.lang.String declaringTypeName
The binary name of this type's declaring type ornull
if no such type exists.
-
declaredTypes
private final java.util.List<java.lang.String> declaredTypes
A list of descriptors representing the types that are declared by the parsed type.
-
permittedSubclasses
private final java.util.List<java.lang.String> permittedSubclasses
A list of internal names of permitted subclasses.
-
-
Method Detail
-
visit
public void visit(int classFileVersion, int modifiers, java.lang.String internalName, java.lang.String genericSignature, java.lang.String superClassName, java.lang.String[] interfaceName)
- Overrides:
visit
in classorg.objectweb.asm.ClassVisitor
-
visitOuterClass
public void visitOuterClass(java.lang.String typeName, java.lang.String methodName, java.lang.String methodDescriptor)
- Overrides:
visitOuterClass
in classorg.objectweb.asm.ClassVisitor
-
visitInnerClass
public void visitInnerClass(java.lang.String internalName, java.lang.String outerName, java.lang.String innerName, int modifiers)
- Overrides:
visitInnerClass
in classorg.objectweb.asm.ClassVisitor
-
visitTypeAnnotation
public org.objectweb.asm.AnnotationVisitor visitTypeAnnotation(int rawTypeReference, org.objectweb.asm.TypePath typePath, java.lang.String descriptor, boolean visible)
- Overrides:
visitTypeAnnotation
in classorg.objectweb.asm.ClassVisitor
-
visitAnnotation
public org.objectweb.asm.AnnotationVisitor visitAnnotation(java.lang.String descriptor, boolean visible)
- Overrides:
visitAnnotation
in classorg.objectweb.asm.ClassVisitor
-
visitField
public org.objectweb.asm.FieldVisitor visitField(int modifiers, java.lang.String internalName, java.lang.String descriptor, java.lang.String genericSignature, java.lang.Object defaultValue)
- Overrides:
visitField
in classorg.objectweb.asm.ClassVisitor
-
visitMethod
public org.objectweb.asm.MethodVisitor visitMethod(int modifiers, java.lang.String internalName, java.lang.String descriptor, java.lang.String genericSignature, java.lang.String[] exceptionName)
- Overrides:
visitMethod
in classorg.objectweb.asm.ClassVisitor
-
visitNestHost
public void visitNestHost(java.lang.String nestHost)
- Overrides:
visitNestHost
in classorg.objectweb.asm.ClassVisitor
-
visitNestMember
public void visitNestMember(java.lang.String nestMember)
- Overrides:
visitNestMember
in classorg.objectweb.asm.ClassVisitor
-
visitRecordComponent
public org.objectweb.asm.RecordComponentVisitor visitRecordComponent(java.lang.String name, java.lang.String descriptor, java.lang.String signature)
- Overrides:
visitRecordComponent
in classorg.objectweb.asm.ClassVisitor
-
visitPermittedSubclass
public void visitPermittedSubclass(java.lang.String permittedSubclass)
- Overrides:
visitPermittedSubclass
in classorg.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.
-
-