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
Fields Modifier and Type Field Description private java.util.List<TypePool.Default.LazyTypeDescription.AnnotationToken>annotationTokensA list of annotation tokens declared on the found method.private AnnotationValue<?,?>defaultValueThe default value of the found method ornullif no such value exists.private java.lang.StringdescriptorThe descriptor found for this method.private java.lang.String[]exceptionNameAn array of internal names of the exceptions of the found method ornullif there are no such exceptions.private java.util.Map<java.lang.Integer,java.util.Map<java.lang.String,java.util.List<TypePool.Default.LazyTypeDescription.AnnotationToken>>>exceptionTypeAnnotationTokensA mapping of the exception types' type annotations by their indices.private org.objectweb.asm.LabelfirstLabelThe first label that is found in the method's body, if any, denoting the start of the method.private java.lang.StringgenericSignatureThe generic signature of the method ornullif it is not generic.private java.lang.StringinternalNameThe internal name found for this method.private intinvisibleParameterShiftA shift index for invisible parameters that indicates a deviation of the actual parameter index.private TypePool.Default.ParameterBaglegacyParameterBagA bag of parameter meta information representing debugging information which allows to extract a method's parameter names.private intmodifiersThe modifiers found for this method.private java.util.Map<java.lang.Integer,java.util.List<TypePool.Default.LazyTypeDescription.AnnotationToken>>parameterAnnotationTokensA mapping of parameter indices to annotation tokens found for the parameters at these indices.private java.util.List<TypePool.Default.LazyTypeDescription.MethodToken.ParameterToken>parameterTokensA 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.private java.util.Map<java.lang.Integer,java.util.Map<java.lang.String,java.util.List<TypePool.Default.LazyTypeDescription.AnnotationToken>>>parameterTypeAnnotationTokensA mapping of the parameters' type annotations by their indices.private java.util.Map<java.lang.String,java.util.List<TypePool.Default.LazyTypeDescription.AnnotationToken>>receiverTypeAnnotationTokensA mapping of the receiver type's type annotations.private java.util.Map<java.lang.String,java.util.List<TypePool.Default.LazyTypeDescription.AnnotationToken>>returnTypeAnnotationTokensA mapping of the method's return type's type annotations.private java.util.Map<java.lang.Integer,java.util.Map<java.lang.String,java.util.List<TypePool.Default.LazyTypeDescription.AnnotationToken>>>typeVariableAnnotationTokensA mapping of the method's type variables' type annotations 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>>>>typeVariableBoundAnnotationTokensA mapping of the method's type variables' bounds' type annotations by their indices and each variable's index.private intvisibleParameterShiftA shift index for visible parameters that indicates a deviation of the actual parameter index.
-
Constructor Summary
Constructors Modifier Constructor Description protectedMethodExtractor(int modifiers, java.lang.String internalName, java.lang.String descriptor, java.lang.String genericSignature, java.lang.String[] exceptionName)Creates a method extractor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidonComplete()Called once all annotation values are visited.voidregister(java.lang.String ignored, AnnotationValue<?,?> annotationValue)Registers an annotation value.voidvisitAnnotableParameterCount(int count, boolean visible)org.objectweb.asm.AnnotationVisitorvisitAnnotation(java.lang.String descriptor, boolean visible)org.objectweb.asm.AnnotationVisitorvisitAnnotationDefault()voidvisitEnd()voidvisitLabel(org.objectweb.asm.Label label)voidvisitLocalVariable(java.lang.String name, java.lang.String descriptor, java.lang.String signature, org.objectweb.asm.Label start, org.objectweb.asm.Label end, int offset)voidvisitParameter(java.lang.String name, int modifiers)org.objectweb.asm.AnnotationVisitorvisitParameterAnnotation(int index, java.lang.String descriptor, boolean visible)org.objectweb.asm.AnnotationVisitorvisitTypeAnnotation(int rawTypeReference, org.objectweb.asm.TypePath typePath, java.lang.String descriptor, boolean visible)-
Methods inherited from class org.objectweb.asm.MethodVisitor
getDelegate, visitAttribute, visitCode, visitFieldInsn, visitFrame, visitIincInsn, visitInsn, visitInsnAnnotation, visitIntInsn, visitInvokeDynamicInsn, visitJumpInsn, visitLdcInsn, visitLineNumber, visitLocalVariableAnnotation, visitLookupSwitchInsn, visitMaxs, visitMethodInsn, visitMethodInsn, visitMultiANewArrayInsn, visitTableSwitchInsn, visitTryCatchAnnotation, visitTryCatchBlock, visitTypeInsn, visitVarInsn
-
-
-
-
Field Detail
-
modifiers
private final int modifiers
The modifiers found for this method.
-
internalName
private final java.lang.String internalName
The internal name found for this method.
-
descriptor
private final java.lang.String descriptor
The descriptor found for this method.
-
genericSignature
@MaybeNull private final java.lang.String genericSignature
The generic signature of the method ornullif it is not generic.
-
exceptionName
@MaybeNull private final java.lang.String[] exceptionName
An array of internal names of the exceptions of the found method ornullif there are no such exceptions.
-
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 method's type variables' type annotations by their indices.
-
typeVariableBoundAnnotationTokens
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>>>> typeVariableBoundAnnotationTokens
A mapping of the method's type variables' bounds' type annotations by their indices and each variable's index.
-
returnTypeAnnotationTokens
private final java.util.Map<java.lang.String,java.util.List<TypePool.Default.LazyTypeDescription.AnnotationToken>> returnTypeAnnotationTokens
A mapping of the method's return type's type annotations.
-
parameterTypeAnnotationTokens
private final java.util.Map<java.lang.Integer,java.util.Map<java.lang.String,java.util.List<TypePool.Default.LazyTypeDescription.AnnotationToken>>> parameterTypeAnnotationTokens
A mapping of the parameters' type annotations by their indices.
-
exceptionTypeAnnotationTokens
private final java.util.Map<java.lang.Integer,java.util.Map<java.lang.String,java.util.List<TypePool.Default.LazyTypeDescription.AnnotationToken>>> exceptionTypeAnnotationTokens
A mapping of the exception types' type annotations by their indices.
-
receiverTypeAnnotationTokens
private final java.util.Map<java.lang.String,java.util.List<TypePool.Default.LazyTypeDescription.AnnotationToken>> receiverTypeAnnotationTokens
A mapping of the receiver type's type annotations.
-
annotationTokens
private final java.util.List<TypePool.Default.LazyTypeDescription.AnnotationToken> annotationTokens
A list of annotation tokens declared on the found method.
-
parameterAnnotationTokens
private final java.util.Map<java.lang.Integer,java.util.List<TypePool.Default.LazyTypeDescription.AnnotationToken>> parameterAnnotationTokens
A mapping of parameter indices to annotation tokens found for the parameters at these indices.
-
parameterTokens
private final java.util.List<TypePool.Default.LazyTypeDescription.MethodToken.ParameterToken> 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
private final TypePool.Default.ParameterBag legacyParameterBag
A bag of parameter meta information representing debugging information which allows to extract a method's parameter names.
-
firstLabel
@MaybeNull private org.objectweb.asm.Label 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 visibleParameterShift
A shift index for visible parameters that indicates a deviation of the actual parameter index.
-
invisibleParameterShift
private int invisibleParameterShift
A shift index for invisible parameters that indicates a deviation of the actual parameter index.
-
defaultValue
@MaybeNull private AnnotationValue<?,?> defaultValue
The default value of the found method ornullif no such value exists.
-
-
Constructor Detail
-
MethodExtractor
protected MethodExtractor(int modifiers, java.lang.String internalName, java.lang.String descriptor, @MaybeNull java.lang.String genericSignature, @MaybeNull java.lang.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 ornullif it is not generic.exceptionName- An array of internal names of the exceptions of the found method ornullif there are no such exceptions.
-
-
Method Detail
-
visitTypeAnnotation
@MaybeNull public org.objectweb.asm.AnnotationVisitor visitTypeAnnotation(int rawTypeReference, org.objectweb.asm.TypePath typePath, java.lang.String descriptor, boolean visible)
- Overrides:
visitTypeAnnotationin classorg.objectweb.asm.MethodVisitor
-
visitAnnotation
public org.objectweb.asm.AnnotationVisitor visitAnnotation(java.lang.String descriptor, boolean visible)- Overrides:
visitAnnotationin classorg.objectweb.asm.MethodVisitor
-
visitAnnotableParameterCount
public void visitAnnotableParameterCount(int count, boolean visible)- Overrides:
visitAnnotableParameterCountin classorg.objectweb.asm.MethodVisitor
-
visitParameterAnnotation
public org.objectweb.asm.AnnotationVisitor visitParameterAnnotation(int index, java.lang.String descriptor, boolean visible)- Overrides:
visitParameterAnnotationin classorg.objectweb.asm.MethodVisitor
-
visitLabel
public void visitLabel(org.objectweb.asm.Label label)
- Overrides:
visitLabelin classorg.objectweb.asm.MethodVisitor
-
visitLocalVariable
public void visitLocalVariable(java.lang.String name, java.lang.String descriptor, java.lang.String signature, org.objectweb.asm.Label start, org.objectweb.asm.Label end, int offset)- Overrides:
visitLocalVariablein classorg.objectweb.asm.MethodVisitor
-
visitParameter
public void visitParameter(@MaybeNull java.lang.String name, int modifiers)
- Overrides:
visitParameterin classorg.objectweb.asm.MethodVisitor
-
visitAnnotationDefault
public org.objectweb.asm.AnnotationVisitor visitAnnotationDefault()
- Overrides:
visitAnnotationDefaultin classorg.objectweb.asm.MethodVisitor
-
register
public void register(java.lang.String ignored, AnnotationValue<?,?> annotationValue)Registers an annotation value.- Specified by:
registerin 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:
onCompletein interfaceTypePool.Default.AnnotationRegistrant
-
visitEnd
public void visitEnd()
- Overrides:
visitEndin classorg.objectweb.asm.MethodVisitor
-
-