Class AnnotationAppender.Target.OnMethodParameter
java.lang.Object
net.bytebuddy.implementation.attribute.AnnotationAppender.Target.OnMethodParameter
- All Implemented Interfaces:
AnnotationAppender.Target
- Enclosing interface:
- AnnotationAppender.Target
@Enhance
public static class AnnotationAppender.Target.OnMethodParameter
extends Object
implements AnnotationAppender.Target
Target for an annotation that is written to a Java method or constructor parameter.
-
Nested Class Summary
Nested classes/interfaces inherited from interface net.bytebuddy.implementation.attribute.AnnotationAppender.Target
AnnotationAppender.Target.OnField, AnnotationAppender.Target.OnMethod, AnnotationAppender.Target.OnMethodParameter, AnnotationAppender.Target.OnRecordComponent, AnnotationAppender.Target.OnType
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final org.objectweb.asm.MethodVisitor
The method visitor to write the annotation to.private final int
The method parameter index to write the annotation to. -
Constructor Summary
ConstructorsConstructorDescriptionOnMethodParameter
(org.objectweb.asm.MethodVisitor methodVisitor, int parameterIndex) Creates a new wrapper for a Java method or constructor. -
Method Summary
Modifier and TypeMethodDescriptionorg.objectweb.asm.AnnotationVisitor
Creates an annotation visitor for writing the specified annotation.org.objectweb.asm.AnnotationVisitor
Creates an annotation visitor for writing the specified type annotation.
-
Field Details
-
methodVisitor
private final org.objectweb.asm.MethodVisitor methodVisitorThe method visitor to write the annotation to. -
parameterIndex
private final int parameterIndexThe method parameter index to write the annotation to.
-
-
Constructor Details
-
OnMethodParameter
public OnMethodParameter(org.objectweb.asm.MethodVisitor methodVisitor, int parameterIndex) Creates a new wrapper for a Java method or constructor.- Parameters:
methodVisitor
- The ASM method visitor to which the annotations are appended to.parameterIndex
- The index of the method parameter.
-
-
Method Details
-
visit
@MaybeNull public org.objectweb.asm.AnnotationVisitor visit(String annotationTypeDescriptor, boolean visible) Creates an annotation visitor for writing the specified annotation.- Specified by:
visit
in interfaceAnnotationAppender.Target
- Parameters:
annotationTypeDescriptor
- The type descriptor for the annotation to be written.visible
-true
if the annotation is to be visible at runtime.- Returns:
- An annotation visitor for consuming the specified annotation.
-
visit
@MaybeNull public org.objectweb.asm.AnnotationVisitor visit(String annotationTypeDescriptor, boolean visible, int typeReference, String typePath) Creates an annotation visitor for writing the specified type annotation.- Specified by:
visit
in interfaceAnnotationAppender.Target
- Parameters:
annotationTypeDescriptor
- The type descriptor for the annotation to be written.visible
-true
if the annotation is to be visible at runtime.typeReference
- The type annotation's type reference.typePath
- The type annotation's type path.- Returns:
- An annotation visitor for consuming the specified annotation.
-