Class TypeAttributeAppender.Explicit

  • All Implemented Interfaces:
    TypeAttributeAppender
    Enclosing interface:
    TypeAttributeAppender

    @Enhance
    public static class TypeAttributeAppender.Explicit
    extends java.lang.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.
    • Field Detail

      • annotations

        private final java.util.List<? extends AnnotationDescription> annotations
        The annotations to write to the given type.
    • Constructor Detail

      • Explicit

        public Explicit​(java.util.List<? extends AnnotationDescription> annotations)
        Creates a new annotation attribute appender for explicit annotation values.
        Parameters:
        annotations - The annotations to write to the given type.
    • Method Detail

      • apply

        public void apply​(org.objectweb.asm.ClassVisitor classVisitor,
                          TypeDescription instrumentedType,
                          AnnotationValueFilter annotationValueFilter)
        Applies this type attribute appender.
        Specified by:
        apply in interface TypeAttributeAppender
        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.