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.ClassVisitorA 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 classTypePool.Default.TypeExtractor.AnnotationExtractorAn annotation extractor reads an annotation found in a class field an collects data that is relevant to creating a related annotation description.protected classTypePool.Default.TypeExtractor.FieldExtractorA field extractor reads a field within a class file and collects data that is relevant to creating a related field description.protected classTypePool.Default.TypeExtractor.MethodExtractorA method extractor reads a method within a class file and collects data that is relevant to creating a related method description.protected classTypePool.Default.TypeExtractor.RecordComponentExtractorA record component extractor reads a record component's information within a class file.
-
Field Summary
Fields Modifier and Type Field Description private intactualModifiersThe actual modifiers found for this type.private java.util.List<TypePool.Default.LazyTypeDescription.AnnotationToken>annotationTokensA list of annotation tokens describing annotations that are found on the visited type.private booleananonymousTypetrueif this type was found to represent an anonymous type.private java.util.List<java.lang.String>declaredTypesA list of descriptors representing the types that are declared by the parsed type.private java.lang.StringdeclaringTypeNameThe binary name of this type's declaring type ornullif no such type exists.private java.util.List<TypePool.Default.LazyTypeDescription.FieldToken>fieldTokensA list of field tokens describing fields that are found on the visited type.private java.lang.StringgenericSignatureThe generic signature of the type ornullif it is not generic.private java.lang.String[]interfaceNameA list of internal names of interfaces implemented by this type ornullif no interfaces are implemented.private java.lang.StringinternalNameThe internal name found for this type.private java.util.List<TypePool.Default.LazyTypeDescription.MethodToken>methodTokensA list of method tokens describing annotations that are found on the visited type.private intmodifiersThe modifiers found for this type.private java.lang.StringnestHostThe nest host that was found in the class file ornullif no nest host was specified.private java.util.List<java.lang.String>nestMembersA list of nest members that were found in the class file.private java.util.List<java.lang.String>permittedSubclassesA list of internal names of permitted subclasses.private static intREAL_MODIFIER_MASKA mask that cuts off pseudo flags beyond the second byte that are inserted by ASM.private java.util.List<TypePool.Default.LazyTypeDescription.RecordComponentToken>recordComponentTokensA list of record component tokens that are found on the visited type.private java.lang.StringsuperClassNameThe internal name of the super type found for this type ornullif no such type exists.private java.util.Map<java.lang.Integer,java.util.Map<java.lang.String,java.util.List<TypePool.Default.LazyTypeDescription.AnnotationToken>>>superTypeAnnotationTokensA mapping of the super types' type annotation tokens by their indices.private TypePool.Default.LazyTypeDescription.TypeContainmenttypeContainmentThe 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>>>typeVariableAnnotationTokensA 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>>>>typeVariableBoundsAnnotationTokensA mapping of the type variables' bounds' type annotation tokens by their indices and each variables index.
-
Constructor Summary
Constructors Modifier Constructor Description protectedTypeExtractor()Creates a new type extractor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected TypeDescriptiontoTypeDescription()Creates a type description from all data that is currently collected.voidvisit(int classFileVersion, int modifiers, java.lang.String internalName, java.lang.String genericSignature, java.lang.String superClassName, java.lang.String[] interfaceName)org.objectweb.asm.AnnotationVisitorvisitAnnotation(java.lang.String descriptor, boolean visible)org.objectweb.asm.FieldVisitorvisitField(int modifiers, java.lang.String internalName, java.lang.String descriptor, java.lang.String genericSignature, java.lang.Object defaultValue)voidvisitInnerClass(java.lang.String internalName, java.lang.String outerName, java.lang.String innerName, int modifiers)org.objectweb.asm.MethodVisitorvisitMethod(int modifiers, java.lang.String internalName, java.lang.String descriptor, java.lang.String genericSignature, java.lang.String[] exceptionName)voidvisitNestHost(java.lang.String nestHost)voidvisitNestMember(java.lang.String nestMember)voidvisitOuterClass(java.lang.String typeName, java.lang.String methodName, java.lang.String methodDescriptor)voidvisitPermittedSubclass(java.lang.String permittedSubclass)org.objectweb.asm.RecordComponentVisitorvisitRecordComponent(java.lang.String name, java.lang.String descriptor, java.lang.String signature)org.objectweb.asm.AnnotationVisitorvisitTypeAnnotation(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 ornullif no such type exists.
-
genericSignature
private java.lang.String genericSignature
The generic signature of the type ornullif it is not generic.
-
interfaceName
private java.lang.String[] interfaceName
A list of internal names of interfaces implemented by this type ornullif no interfaces are implemented.
-
anonymousType
private boolean anonymousType
trueif 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 ornullif 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 ornullif 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:
visitin classorg.objectweb.asm.ClassVisitor
-
visitOuterClass
public void visitOuterClass(java.lang.String typeName, java.lang.String methodName, java.lang.String methodDescriptor)- Overrides:
visitOuterClassin classorg.objectweb.asm.ClassVisitor
-
visitInnerClass
public void visitInnerClass(java.lang.String internalName, java.lang.String outerName, java.lang.String innerName, int modifiers)- Overrides:
visitInnerClassin 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:
visitTypeAnnotationin classorg.objectweb.asm.ClassVisitor
-
visitAnnotation
public org.objectweb.asm.AnnotationVisitor visitAnnotation(java.lang.String descriptor, boolean visible)- Overrides:
visitAnnotationin 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:
visitFieldin 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:
visitMethodin classorg.objectweb.asm.ClassVisitor
-
visitNestHost
public void visitNestHost(java.lang.String nestHost)
- Overrides:
visitNestHostin classorg.objectweb.asm.ClassVisitor
-
visitNestMember
public void visitNestMember(java.lang.String nestMember)
- Overrides:
visitNestMemberin classorg.objectweb.asm.ClassVisitor
-
visitRecordComponent
public org.objectweb.asm.RecordComponentVisitor visitRecordComponent(java.lang.String name, java.lang.String descriptor, java.lang.String signature)- Overrides:
visitRecordComponentin classorg.objectweb.asm.ClassVisitor
-
visitPermittedSubclass
public void visitPermittedSubclass(java.lang.String permittedSubclass)
- Overrides:
visitPermittedSubclassin 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.
-
-