Class AnnotationRemoval.AnnotationRemovingMethodVisitor

  • Enclosing class:
    AnnotationRemoval

    private static class AnnotationRemoval.AnnotationRemovingMethodVisitor
    extends org.objectweb.asm.MethodVisitor
    Creates a visitor for removing annotations from methods and method parameters.
    • Field Summary

      Fields 
      Modifier and Type Field Description
      private ElementMatcher<? super AnnotationDescription> annotationMatcher
      Matches annotations that should be removed.
      private java.util.Map<java.lang.String,​AnnotationDescription> annotations
      A map of annotation type descriptors names and descriptors to consider for removal.
      private java.util.Map<java.lang.Integer,​java.util.Map<java.lang.String,​AnnotationDescription>> parameterAnnotations
      A map of parameter indices to maps of annotation type descriptors names and descriptors to consider for removal.
      • Fields inherited from class org.objectweb.asm.MethodVisitor

        api, mv
    • 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.AnnotationVisitor visitParameterAnnotation​(int parameter, java.lang.String descriptor, boolean visible)  
      • Methods inherited from class org.objectweb.asm.MethodVisitor

        getDelegate, visitAnnotableParameterCount, visitAnnotationDefault, visitAttribute, visitCode, visitEnd, visitFieldInsn, visitFrame, visitIincInsn, visitInsn, visitInsnAnnotation, visitIntInsn, visitInvokeDynamicInsn, visitJumpInsn, visitLabel, visitLdcInsn, visitLineNumber, visitLocalVariable, visitLocalVariableAnnotation, visitLookupSwitchInsn, visitMaxs, visitMethodInsn, visitMethodInsn, visitMultiANewArrayInsn, visitParameter, visitTableSwitchInsn, visitTryCatchAnnotation, visitTryCatchBlock, visitTypeAnnotation, visitTypeInsn, visitVarInsn
      • Methods inherited from class java.lang.Object

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

      • parameterAnnotations

        private final java.util.Map<java.lang.Integer,​java.util.Map<java.lang.String,​AnnotationDescription>> parameterAnnotations
        A map of parameter indices to maps of annotation type descriptors 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

      • AnnotationRemovingMethodVisitor

        private AnnotationRemovingMethodVisitor​(org.objectweb.asm.MethodVisitor methodVisitor,
                                                ElementMatcher<? super AnnotationDescription> annotationMatcher,
                                                java.util.Map<java.lang.Integer,​java.util.Map<java.lang.String,​AnnotationDescription>> parameterAnnotations,
                                                java.util.Map<java.lang.String,​AnnotationDescription> annotations)
        Creates an annotation removing method visitor.
        Parameters:
        methodVisitor - The method visitor to delegate to.
        annotationMatcher - Matches annotations that should be removed.
        parameterAnnotations - A map of parameter indices to maps of annotation type descriptors names and descriptors to consider for removal.
        annotations - A map of annotation type descriptors names and descriptors to consider for removal.
    • Method Detail

      • visitParameterAnnotation

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

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