Class TypeAttributeAppender.Explicit
java.lang.Object
net.bytebuddy.implementation.attribute.TypeAttributeAppender.Explicit
- All Implemented Interfaces:
TypeAttributeAppender
- Enclosing interface:
TypeAttributeAppender
@Enhance
public static class TypeAttributeAppender.Explicit
extends Object
implements TypeAttributeAppender
An attribute appender that appends a single annotation to a given type. The visibility for the annotation
will be inferred from the annotation's
RetentionPolicy.-
Nested Class Summary
Nested classes/interfaces inherited from interface TypeAttributeAppender
TypeAttributeAppender.Compound, TypeAttributeAppender.Explicit, TypeAttributeAppender.ForInstrumentedType, TypeAttributeAppender.NoOp -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final List<? extends AnnotationDescription> The annotations to write to the given type. -
Constructor Summary
ConstructorsConstructorDescriptionExplicit(List<? extends AnnotationDescription> annotations) Creates a new annotation attribute appender for explicit annotation values. -
Method Summary
Modifier and TypeMethodDescriptionvoidapply(org.objectweb.asm.ClassVisitor classVisitor, TypeDescription instrumentedType, AnnotationValueFilter annotationValueFilter) Applies this type attribute appender.
-
Field Details
-
annotations
The annotations to write to the given type.
-
-
Constructor Details
-
Explicit
Creates a new annotation attribute appender for explicit annotation values.- Parameters:
annotations- The annotations to write to the given type.
-
-
Method Details
-
apply
public void apply(org.objectweb.asm.ClassVisitor classVisitor, TypeDescription instrumentedType, AnnotationValueFilter annotationValueFilter) Applies this type attribute appender.- Specified by:
applyin interfaceTypeAttributeAppender- Parameters:
classVisitor- The class visitor to which the annotations of this visitor should be written to.instrumentedType- A description of the instrumented type that is target of the ongoing instrumentation.annotationValueFilter- The annotation value filter to apply when writing annotations.
-