Class AnnotationRemoval.AnnotationRemovingClassVisitor

  • Enclosing class:
    AnnotationRemoval

    private static class AnnotationRemoval.AnnotationRemovingClassVisitor
    extends org.objectweb.asm.ClassVisitor
    A class visitor that removes annotations.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      org.objectweb.asm.AnnotationVisitor visitAnnotation​(java.lang.String descriptor, boolean visible)  
      org.objectweb.asm.FieldVisitor visitField​(int modifiers, java.lang.String internalName, java.lang.String descriptor, java.lang.String signature, java.lang.Object value)  
      org.objectweb.asm.MethodVisitor visitMethod​(int modifiers, java.lang.String internalName, java.lang.String descriptor, java.lang.String signature, java.lang.String[] exception)  
      • Methods inherited from class org.objectweb.asm.ClassVisitor

        getDelegate, visit, visitAttribute, visitEnd, visitInnerClass, visitModule, visitNestHost, visitNestMember, visitOuterClass, visitPermittedSubclass, visitRecordComponent, visitSource, visitTypeAnnotation
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • parameters

        private final int parameters
        Indices the method parameter index from which annotations should be removed, or a negative value to indicate different treatment.
      • fields

        private final java.util.Map<java.lang.String,​FieldDescription.InDefinedShape> fields
        A map of internal field names and descriptors to consider for removal.
      • methods

        private final java.util.Map<java.lang.String,​MethodDescription> methods
        A map of internal method names and descriptors to consider for removal.
      • annotations

        private final java.util.Map<java.lang.String,​AnnotationDescription> annotations
        A map of annotation type descriptors names and descriptors to consider for removal.
    • Constructor Detail

      • AnnotationRemovingClassVisitor

        private AnnotationRemovingClassVisitor​(org.objectweb.asm.ClassVisitor classVisitor,
                                               ElementMatcher<? super FieldDescription.InDefinedShape> fieldMatcher,
                                               ElementMatcher<? super MethodDescription> methodMatcher,
                                               ElementMatcher<? super AnnotationDescription> annotationMatcher,
                                               int parameters,
                                               java.util.Map<java.lang.String,​FieldDescription.InDefinedShape> fields,
                                               java.util.Map<java.lang.String,​MethodDescription> methods,
                                               java.util.Map<java.lang.String,​AnnotationDescription> annotations)
        Creates a class visitor for annotation removal.
        Parameters:
        classVisitor - The class visitor to delegate to.
        fieldMatcher - Matches fields from which annotations should be removed.
        methodMatcher - Matches methods from which annotations should be removed.
        annotationMatcher - Matches annotations that should be removed.
        parameters - Indices the method parameter index from which annotations should be removed, or a negative value to indicate different treatment.
        fields - A map of internal field names and descriptors to consider for removal.
        methods - A map of internal method names and descriptors to consider for removal.
        annotations - A map of annotation type descriptors names and descriptors to consider for removal.
    • Method Detail

      • visitAnnotation

        @MaybeNull
        public org.objectweb.asm.AnnotationVisitor visitAnnotation​(java.lang.String descriptor,
                                                                   boolean visible)
        Overrides:
        visitAnnotation in class org.objectweb.asm.ClassVisitor
      • visitField

        @MaybeNull
        public org.objectweb.asm.FieldVisitor visitField​(int modifiers,
                                                         java.lang.String internalName,
                                                         java.lang.String descriptor,
                                                         java.lang.String signature,
                                                         java.lang.Object value)
        Overrides:
        visitField in class org.objectweb.asm.ClassVisitor
      • visitMethod

        @MaybeNull
        public org.objectweb.asm.MethodVisitor visitMethod​(int modifiers,
                                                           java.lang.String internalName,
                                                           java.lang.String descriptor,
                                                           java.lang.String signature,
                                                           java.lang.String[] exception)
        Overrides:
        visitMethod in class org.objectweb.asm.ClassVisitor