Class MetadataAwareClassVisitor

    • Field Summary

      Fields 
      Modifier and Type Field Description
      private boolean triggerAttributes
      true if the attribute visitation is not yet completed.
      private boolean triggerModule
      true if the module information was not yet visited.
      private boolean triggerNestHost
      true if the nest host was not yet visited.
      private boolean triggerOuterClass
      true if the outer class was not yet visited.
      private boolean triggerSource
      true if the sources were not yet visited.
      • Fields inherited from class org.objectweb.asm.ClassVisitor

        api, cv
    • Constructor Summary

      Constructors 
      Modifier Constructor Description
      protected MetadataAwareClassVisitor​(int api, org.objectweb.asm.ClassVisitor classVisitor)
      Creates a metadata aware class visitor.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      private void considerTriggerAfterAttributes()
      Considers triggering the after attribute visitation.
      private void considerTriggerModule()
      Considers triggering a module visitation.
      private void considerTriggerNestHost()
      Considers triggering a nest host visitation.
      private void considerTriggerOuterClass()
      Considers triggering an outer class visitation.
      private void considerTriggerSource()
      Considers triggering a source visitation.
      protected void onAfterAttributes()
      Invoked if the attribute visitation is about to complete.
      protected void onModule()
      Invoked if the module was not visited.
      protected void onNestHost()
      Invoked if the nest host was not visited.
      protected void onOuterType()
      Invoked if the outer class was not visited.
      protected void onSource()
      Invoked if the sources were not visited.
      protected org.objectweb.asm.AnnotationVisitor onVisitAnnotation​(java.lang.String descriptor, boolean visible)
      An order-sensitive invocation of ClassVisitor.visitAnnotation(String, boolean).
      protected void onVisitAttribute​(org.objectweb.asm.Attribute attribute)
      An order-sensitive invocation of ClassVisitor.visitAttribute(Attribute).
      protected void onVisitEnd()
      An order-sensitive invocation of ClassVisitor.visitEnd().
      protected org.objectweb.asm.FieldVisitor onVisitField​(int modifiers, java.lang.String internalName, java.lang.String descriptor, java.lang.String signature, java.lang.Object value)
      An order-sensitive invocation of ClassVisitor.visitField(int, String, String, String, Object).
      protected void onVisitInnerClass​(java.lang.String internalName, java.lang.String outerName, java.lang.String innerName, int modifiers)
      An order-sensitive invocation of ClassVisitor.visitInnerClass(String, String, String, int).
      protected org.objectweb.asm.MethodVisitor onVisitMethod​(int modifiers, java.lang.String internalName, java.lang.String descriptor, java.lang.String signature, java.lang.String[] exception)
      An order-sensitive invocation of ClassVisitor.visitMethod(int, String, String, String, String[]).
      protected org.objectweb.asm.ModuleVisitor onVisitModule​(java.lang.String name, int modifiers, java.lang.String version)
      An order-sensitive invocation og ClassVisitor.visitModule(String, int, String).
      protected void onVisitNestHost​(java.lang.String nestHost)
      An order-sensitive invocation of ClassVisitor.visitNestHost(String).
      protected void onVisitNestMember​(java.lang.String nestMember)
      An order-sensitive invocation of ClassVisitor.visitNestMember(String).
      protected void onVisitOuterClass​(java.lang.String owner, java.lang.String name, java.lang.String descriptor)
      An order-sensitive invocation of ClassVisitor.visitOuterClass(String, String, String).
      protected void onVisitPermittedSubclass​(java.lang.String permittedSubclass)
      An order-sensitive invocation of ClassVisitor#visitPermittedSubclass.
      protected org.objectweb.asm.RecordComponentVisitor onVisitRecordComponent​(java.lang.String name, java.lang.String descriptor, java.lang.String signature)
      An order-sensitive invocation of ClassVisitor.visitRecordComponent(String, String, String).
      protected void onVisitSource​(java.lang.String source, java.lang.String debug)
      An order-sensitive invocation og ClassVisitor.visitSource(String, String).
      protected org.objectweb.asm.AnnotationVisitor onVisitTypeAnnotation​(int typeReference, org.objectweb.asm.TypePath typePath, java.lang.String descriptor, boolean visible)
      An order-sensitive invocation of ClassVisitor.visitTypeAnnotation(int, TypePath, String, boolean).
      org.objectweb.asm.AnnotationVisitor visitAnnotation​(java.lang.String descriptor, boolean visible)  
      void visitAttribute​(org.objectweb.asm.Attribute attribute)  
      void visitEnd()  
      org.objectweb.asm.FieldVisitor visitField​(int modifiers, java.lang.String internalName, java.lang.String descriptor, java.lang.String signature, java.lang.Object value)  
      void visitInnerClass​(java.lang.String name, java.lang.String outerName, java.lang.String innerName, int modifiers)  
      org.objectweb.asm.MethodVisitor visitMethod​(int modifiers, java.lang.String internalName, java.lang.String descriptor, java.lang.String signature, java.lang.String[] exception)  
      org.objectweb.asm.ModuleVisitor visitModule​(java.lang.String name, int access, java.lang.String version)  
      void visitNestHost​(java.lang.String nestHost)  
      void visitNestMember​(java.lang.String nestMember)  
      void visitOuterClass​(java.lang.String owner, java.lang.String name, java.lang.String descriptor)  
      void visitPermittedSubclass​(java.lang.String permittedSubclass)  
      org.objectweb.asm.RecordComponentVisitor visitRecordComponent​(java.lang.String name, java.lang.String descriptor, java.lang.String signature)  
      void visitSource​(java.lang.String source, java.lang.String debug)  
      org.objectweb.asm.AnnotationVisitor visitTypeAnnotation​(int typeReference, org.objectweb.asm.TypePath typePath, java.lang.String descriptor, boolean visible)  
      • Methods inherited from class org.objectweb.asm.ClassVisitor

        getDelegate, visit
      • Methods inherited from class java.lang.Object

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

      • triggerSource

        private boolean triggerSource
        true if the sources were not yet visited.
      • triggerModule

        private boolean triggerModule
        true if the module information was not yet visited.
      • triggerNestHost

        private boolean triggerNestHost
        true if the nest host was not yet visited.
      • triggerOuterClass

        private boolean triggerOuterClass
        true if the outer class was not yet visited.
      • triggerAttributes

        private boolean triggerAttributes
        true if the attribute visitation is not yet completed.
    • Constructor Detail

      • MetadataAwareClassVisitor

        protected MetadataAwareClassVisitor​(int api,
                                            org.objectweb.asm.ClassVisitor classVisitor)
        Creates a metadata aware class visitor.
        Parameters:
        api - The API version.
        classVisitor - The class visitor to delegate to.
    • Method Detail

      • onSource

        protected void onSource()
        Invoked if the sources were not visited.
      • onModule

        protected void onModule()
        Invoked if the module was not visited.
      • onNestHost

        protected void onNestHost()
        Invoked if the nest host was not visited.
      • onOuterType

        protected void onOuterType()
        Invoked if the outer class was not visited.
      • onAfterAttributes

        protected void onAfterAttributes()
        Invoked if the attribute visitation is about to complete.
      • considerTriggerSource

        private void considerTriggerSource()
        Considers triggering a source visitation.
      • considerTriggerModule

        private void considerTriggerModule()
        Considers triggering a module visitation.
      • considerTriggerNestHost

        private void considerTriggerNestHost()
        Considers triggering a nest host visitation.
      • considerTriggerOuterClass

        private void considerTriggerOuterClass()
        Considers triggering an outer class visitation.
      • considerTriggerAfterAttributes

        private void considerTriggerAfterAttributes()
        Considers triggering the after attribute visitation.
      • visitSource

        public final void visitSource​(@MaybeNull
                                      java.lang.String source,
                                      @MaybeNull
                                      java.lang.String debug)
        Overrides:
        visitSource in class org.objectweb.asm.ClassVisitor
      • onVisitSource

        protected void onVisitSource​(@MaybeNull
                                     java.lang.String source,
                                     @MaybeNull
                                     java.lang.String debug)
        An order-sensitive invocation og ClassVisitor.visitSource(String, String).
        Parameters:
        source - The name of the source file or null if not available.
        debug - Additional debug information or null if not available.
      • visitModule

        @MaybeNull
        public final org.objectweb.asm.ModuleVisitor visitModule​(java.lang.String name,
                                                                 int access,
                                                                 @MaybeNull
                                                                 java.lang.String version)
        Overrides:
        visitModule in class org.objectweb.asm.ClassVisitor
      • onVisitModule

        @MaybeNull
        protected org.objectweb.asm.ModuleVisitor onVisitModule​(java.lang.String name,
                                                                int modifiers,
                                                                @MaybeNull
                                                                java.lang.String version)
        An order-sensitive invocation og ClassVisitor.visitModule(String, int, String).
        Parameters:
        name - The name of the module
        modifiers - The modifiers of the module.
        version - The module version or null if not available.
        Returns:
        A visitor for the module information or null if skipped.
      • visitNestHost

        public final void visitNestHost​(java.lang.String nestHost)
        Overrides:
        visitNestHost in class org.objectweb.asm.ClassVisitor
      • onVisitNestHost

        protected void onVisitNestHost​(java.lang.String nestHost)
        An order-sensitive invocation of ClassVisitor.visitNestHost(String).
        Parameters:
        nestHost - The internal name of the nest host.
      • visitOuterClass

        public final void visitOuterClass​(java.lang.String owner,
                                          @MaybeNull
                                          java.lang.String name,
                                          @MaybeNull
                                          java.lang.String descriptor)
        Overrides:
        visitOuterClass in class org.objectweb.asm.ClassVisitor
      • onVisitOuterClass

        protected void onVisitOuterClass​(java.lang.String owner,
                                         @MaybeNull
                                         java.lang.String name,
                                         @MaybeNull
                                         java.lang.String descriptor)
        An order-sensitive invocation of ClassVisitor.visitOuterClass(String, String, String).
        Parameters:
        owner - The outer class's internal name.
        name - The outer method's name or null if it does not exist.
        descriptor - The outer method's descriptor or null if it does not exist.
      • visitPermittedSubclass

        public final void visitPermittedSubclass​(java.lang.String permittedSubclass)
        Overrides:
        visitPermittedSubclass in class org.objectweb.asm.ClassVisitor
      • onVisitPermittedSubclass

        protected void onVisitPermittedSubclass​(java.lang.String permittedSubclass)
        An order-sensitive invocation of ClassVisitor#visitPermittedSubclass.
        Parameters:
        permittedSubclass - The internal name of the permitted subclass.
      • visitRecordComponent

        @MaybeNull
        public final org.objectweb.asm.RecordComponentVisitor visitRecordComponent​(java.lang.String name,
                                                                                   java.lang.String descriptor,
                                                                                   @MaybeNull
                                                                                   java.lang.String signature)
        Overrides:
        visitRecordComponent in class org.objectweb.asm.ClassVisitor
      • onVisitRecordComponent

        @MaybeNull
        protected org.objectweb.asm.RecordComponentVisitor onVisitRecordComponent​(java.lang.String name,
                                                                                  java.lang.String descriptor,
                                                                                  @MaybeNull
                                                                                  java.lang.String signature)
        An order-sensitive invocation of ClassVisitor.visitRecordComponent(String, String, String).
        Parameters:
        name - The record component's name.
        descriptor - The record component's descriptor.
        signature - The record component's generic signature or null if the record component's type is non-generic.
        Returns:
        The record component visitor or null if the component should not be visited.
      • visitAnnotation

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

        @MaybeNull
        protected org.objectweb.asm.AnnotationVisitor onVisitAnnotation​(java.lang.String descriptor,
                                                                        boolean visible)
        An order-sensitive invocation of ClassVisitor.visitAnnotation(String, boolean).
        Parameters:
        descriptor - The annotation type's descriptor.
        visible - true if the annotation is visible at runtime.
        Returns:
        An annotation visitor or null if the annotation should be ignored.
      • visitTypeAnnotation

        @MaybeNull
        public final org.objectweb.asm.AnnotationVisitor visitTypeAnnotation​(int typeReference,
                                                                             org.objectweb.asm.TypePath typePath,
                                                                             java.lang.String descriptor,
                                                                             boolean visible)
        Overrides:
        visitTypeAnnotation in class org.objectweb.asm.ClassVisitor
      • onVisitTypeAnnotation

        @MaybeNull
        protected org.objectweb.asm.AnnotationVisitor onVisitTypeAnnotation​(int typeReference,
                                                                            org.objectweb.asm.TypePath typePath,
                                                                            java.lang.String descriptor,
                                                                            boolean visible)
        An order-sensitive invocation of ClassVisitor.visitTypeAnnotation(int, TypePath, String, boolean).
        Parameters:
        typeReference - The type reference of the type annotation.
        typePath - The type path of the type annotation.
        descriptor - The descriptor of the annotation type.
        visible - true if the annotation is visible at runtime.
        Returns:
        An annotation visitor or null if the annotation should be ignored.
      • visitAttribute

        public final void visitAttribute​(org.objectweb.asm.Attribute attribute)
        Overrides:
        visitAttribute in class org.objectweb.asm.ClassVisitor
      • onVisitAttribute

        protected void onVisitAttribute​(org.objectweb.asm.Attribute attribute)
        An order-sensitive invocation of ClassVisitor.visitAttribute(Attribute).
        Parameters:
        attribute - The attribute to visit.
      • visitNestMember

        public final void visitNestMember​(java.lang.String nestMember)
        Overrides:
        visitNestMember in class org.objectweb.asm.ClassVisitor
      • onVisitNestMember

        protected void onVisitNestMember​(java.lang.String nestMember)
        An order-sensitive invocation of ClassVisitor.visitNestMember(String).
        Parameters:
        nestMember - The internal name of the nest member.
      • visitInnerClass

        public final void visitInnerClass​(java.lang.String name,
                                          @MaybeNull
                                          java.lang.String outerName,
                                          @MaybeNull
                                          java.lang.String innerName,
                                          int modifiers)
        Overrides:
        visitInnerClass in class org.objectweb.asm.ClassVisitor
      • onVisitInnerClass

        protected void onVisitInnerClass​(java.lang.String internalName,
                                         @MaybeNull
                                         java.lang.String outerName,
                                         @MaybeNull
                                         java.lang.String innerName,
                                         int modifiers)
        An order-sensitive invocation of ClassVisitor.visitInnerClass(String, String, String, int).
        Parameters:
        internalName - The internal name of the inner class.
        outerName - The internal name of the outer class or null for a member class.
        innerName - The inner class's simple name or null for an anonymous class.
        modifiers - The inner class's source code modifiers.
      • visitField

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

        @MaybeNull
        protected org.objectweb.asm.FieldVisitor onVisitField​(int modifiers,
                                                              java.lang.String internalName,
                                                              java.lang.String descriptor,
                                                              @MaybeNull
                                                              java.lang.String signature,
                                                              @MaybeNull
                                                              java.lang.Object value)
        An order-sensitive invocation of ClassVisitor.visitField(int, String, String, String, Object).
        Parameters:
        modifiers - The field's modifiers.
        internalName - The field's internal name.
        descriptor - The field type's descriptor.
        signature - The field's generic signature or null if the field is not generic.
        value - The field's default value or null if no such value exists.
        Returns:
        A field visitor to visit the field or null to ignore it.
      • visitMethod

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

        @MaybeNull
        protected org.objectweb.asm.MethodVisitor onVisitMethod​(int modifiers,
                                                                java.lang.String internalName,
                                                                java.lang.String descriptor,
                                                                @MaybeNull
                                                                java.lang.String signature,
                                                                @MaybeNull
                                                                java.lang.String[] exception)
        An order-sensitive invocation of ClassVisitor.visitMethod(int, String, String, String, String[]).
        Parameters:
        modifiers - The method's modifiers.
        internalName - The method's internal name.
        descriptor - The field type's descriptor.
        signature - The method's generic signature or null if the method is not generic.
        exception - The method's declared exceptions or null if no exceptions are declared.
        Returns:
        A method visitor to visit the method or null to ignore it.
      • visitEnd

        public final void visitEnd()
        Overrides:
        visitEnd in class org.objectweb.asm.ClassVisitor
      • onVisitEnd

        protected void onVisitEnd()
        An order-sensitive invocation of ClassVisitor.visitEnd().