Package net.bytebuddy.pool
Class TypePool.Default.TypeExtractor.MethodExtractor
java.lang.Object
org.objectweb.asm.MethodVisitor
net.bytebuddy.pool.TypePool.Default.TypeExtractor.MethodExtractor
- All Implemented Interfaces:
TypePool.Default.AnnotationRegistrant
- Enclosing class:
- TypePool.Default.TypeExtractor
protected class TypePool.Default.TypeExtractor.MethodExtractor
extends org.objectweb.asm.MethodVisitor
implements TypePool.Default.AnnotationRegistrant
A method extractor reads a method within a class file and collects data that is relevant
to creating a related method description.
-
Nested Class Summary
Nested classes/interfaces inherited from interface net.bytebuddy.pool.TypePool.Default.AnnotationRegistrant
TypePool.Default.AnnotationRegistrant.AbstractBase, TypePool.Default.AnnotationRegistrant.ForByteCodeElement, TypePool.Default.AnnotationRegistrant.ForTypeVariable
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final List<TypePool.Default.LazyTypeDescription.AnnotationToken>
A list of annotation tokens declared on the found method.private AnnotationValue<?,
?> The default value of the found method ornull
if no such value exists.private final String
The descriptor found for this method.private final String[]
An array of internal names of the exceptions of the found method ornull
if there are no such exceptions.A mapping of the exception types' type annotations by their indices.private org.objectweb.asm.Label
The first label that is found in the method's body, if any, denoting the start of the method.private final String
The generic signature of the method ornull
if it is not generic.private final String
The internal name found for this method.private int
A shift index for invisible parameters that indicates a deviation of the actual parameter index.private final TypePool.Default.ParameterBag
A bag of parameter meta information representing debugging information which allows to extract a method's parameter names.private final int
The modifiers found for this method.private final Map<Integer,
List<TypePool.Default.LazyTypeDescription.AnnotationToken>> A mapping of parameter indices to annotation tokens found for the parameters at these indices.A list of tokens representing meta information of a parameter as it is available for method's that are compiled in the Java 8 version format.A mapping of the parameters' type annotations by their indices.private final Map<String,
List<TypePool.Default.LazyTypeDescription.AnnotationToken>> A mapping of the receiver type's type annotations.private final Map<String,
List<TypePool.Default.LazyTypeDescription.AnnotationToken>> A mapping of the method's return type's type annotations.A mapping of the method's type variables' type annotations by their indices.private final Map<Integer,
Map<Integer, Map<String, List<TypePool.Default.LazyTypeDescription.AnnotationToken>>>> A mapping of the method's type variables' bounds' type annotations by their indices and each variable's index.private int
A shift index for visible parameters that indicates a deviation of the actual parameter index.Fields inherited from class org.objectweb.asm.MethodVisitor
api, mv
-
Constructor Summary
ConstructorsModifierConstructorDescriptionprotected
MethodExtractor
(int modifiers, String internalName, String descriptor, String genericSignature, String[] exceptionName) Creates a method extractor. -
Method Summary
Modifier and TypeMethodDescriptionvoid
Called once all annotation values are visited.void
register
(String ignored, AnnotationValue<?, ?> annotationValue) Registers an annotation value.void
visitAnnotableParameterCount
(int count, boolean visible) org.objectweb.asm.AnnotationVisitor
visitAnnotation
(String descriptor, boolean visible) org.objectweb.asm.AnnotationVisitor
void
visitEnd()
void
visitLabel
(org.objectweb.asm.Label label) void
visitLocalVariable
(String name, String descriptor, String signature, org.objectweb.asm.Label start, org.objectweb.asm.Label end, int index) void
visitParameter
(String name, int modifiers) org.objectweb.asm.AnnotationVisitor
visitParameterAnnotation
(int index, String descriptor, boolean visible) org.objectweb.asm.AnnotationVisitor
visitTypeAnnotation
(int rawTypeReference, org.objectweb.asm.TypePath typePath, String descriptor, boolean visible) Methods inherited from class org.objectweb.asm.MethodVisitor
visitAttribute, visitCode, visitFieldInsn, visitFrame, visitIincInsn, visitInsn, visitInsnAnnotation, visitIntInsn, visitInvokeDynamicInsn, visitJumpInsn, visitLdcInsn, visitLineNumber, visitLocalVariableAnnotation, visitLookupSwitchInsn, visitMaxs, visitMethodInsn, visitMethodInsn, visitMultiANewArrayInsn, visitTableSwitchInsn, visitTryCatchAnnotation, visitTryCatchBlock, visitTypeInsn, visitVarInsn
-
Field Details
-
modifiers
private final int modifiersThe modifiers found for this method. -
internalName
The internal name found for this method. -
descriptor
The descriptor found for this method. -
genericSignature
The generic signature of the method ornull
if it is not generic. -
exceptionName
An array of internal names of the exceptions of the found method ornull
if there are no such exceptions. -
typeVariableAnnotationTokens
private final Map<Integer,Map<String, typeVariableAnnotationTokensList<TypePool.Default.LazyTypeDescription.AnnotationToken>>> A mapping of the method's type variables' type annotations by their indices. -
typeVariableBoundAnnotationTokens
private final Map<Integer,Map<Integer, typeVariableBoundAnnotationTokensMap<String, List<TypePool.Default.LazyTypeDescription.AnnotationToken>>>> A mapping of the method's type variables' bounds' type annotations by their indices and each variable's index. -
returnTypeAnnotationTokens
private final Map<String,List<TypePool.Default.LazyTypeDescription.AnnotationToken>> returnTypeAnnotationTokensA mapping of the method's return type's type annotations. -
parameterTypeAnnotationTokens
private final Map<Integer,Map<String, parameterTypeAnnotationTokensList<TypePool.Default.LazyTypeDescription.AnnotationToken>>> A mapping of the parameters' type annotations by their indices. -
exceptionTypeAnnotationTokens
private final Map<Integer,Map<String, exceptionTypeAnnotationTokensList<TypePool.Default.LazyTypeDescription.AnnotationToken>>> A mapping of the exception types' type annotations by their indices. -
receiverTypeAnnotationTokens
private final Map<String,List<TypePool.Default.LazyTypeDescription.AnnotationToken>> receiverTypeAnnotationTokensA mapping of the receiver type's type annotations. -
annotationTokens
A list of annotation tokens declared on the found method. -
parameterAnnotationTokens
private final Map<Integer,List<TypePool.Default.LazyTypeDescription.AnnotationToken>> parameterAnnotationTokensA mapping of parameter indices to annotation tokens found for the parameters at these indices. -
parameterTokens
A list of tokens representing meta information of a parameter as it is available for method's that are compiled in the Java 8 version format. -
legacyParameterBag
A bag of parameter meta information representing debugging information which allows to extract a method's parameter names. -
firstLabel
The first label that is found in the method's body, if any, denoting the start of the method. This label can be used to identify names of local variables that describe the method's parameters. -
visibleParameterShift
private int visibleParameterShiftA shift index for visible parameters that indicates a deviation of the actual parameter index. -
invisibleParameterShift
private int invisibleParameterShiftA shift index for invisible parameters that indicates a deviation of the actual parameter index. -
defaultValue
The default value of the found method ornull
if no such value exists.
-
-
Constructor Details
-
MethodExtractor
protected MethodExtractor(int modifiers, String internalName, String descriptor, @MaybeNull String genericSignature, @MaybeNull String[] exceptionName) Creates a method extractor.- Parameters:
modifiers
- The modifiers found for this method.internalName
- The internal name found for this method.descriptor
- The descriptor found for this method.genericSignature
- The generic signature of the method ornull
if it is not generic.exceptionName
- An array of internal names of the exceptions of the found method ornull
if there are no such exceptions.
-
-
Method Details
-
visitTypeAnnotation
@MaybeNull public org.objectweb.asm.AnnotationVisitor visitTypeAnnotation(int rawTypeReference, org.objectweb.asm.TypePath typePath, String descriptor, boolean visible) - Overrides:
visitTypeAnnotation
in classorg.objectweb.asm.MethodVisitor
-
visitAnnotation
- Overrides:
visitAnnotation
in classorg.objectweb.asm.MethodVisitor
-
visitAnnotableParameterCount
public void visitAnnotableParameterCount(int count, boolean visible) - Overrides:
visitAnnotableParameterCount
in classorg.objectweb.asm.MethodVisitor
-
visitParameterAnnotation
public org.objectweb.asm.AnnotationVisitor visitParameterAnnotation(int index, String descriptor, boolean visible) - Overrides:
visitParameterAnnotation
in classorg.objectweb.asm.MethodVisitor
-
visitLabel
public void visitLabel(org.objectweb.asm.Label label) - Overrides:
visitLabel
in classorg.objectweb.asm.MethodVisitor
-
visitLocalVariable
public void visitLocalVariable(String name, String descriptor, String signature, org.objectweb.asm.Label start, org.objectweb.asm.Label end, int index) - Overrides:
visitLocalVariable
in classorg.objectweb.asm.MethodVisitor
-
visitParameter
- Overrides:
visitParameter
in classorg.objectweb.asm.MethodVisitor
-
visitAnnotationDefault
public org.objectweb.asm.AnnotationVisitor visitAnnotationDefault()- Overrides:
visitAnnotationDefault
in classorg.objectweb.asm.MethodVisitor
-
register
Registers an annotation value.- Specified by:
register
in interfaceTypePool.Default.AnnotationRegistrant
- Parameters:
ignored
- The name of the annotation value.annotationValue
- The value of the annotation.
-
onComplete
public void onComplete()Called once all annotation values are visited.- Specified by:
onComplete
in interfaceTypePool.Default.AnnotationRegistrant
-
visitEnd
public void visitEnd()- Overrides:
visitEnd
in classorg.objectweb.asm.MethodVisitor
-