Class AsmClassReader.ForAsm

  • All Implemented Interfaces:
    AsmClassReader
    Enclosing interface:
    AsmClassReader

    public static class AsmClassReader.ForAsm
    extends java.lang.Object
    implements AsmClassReader
    A class reader for ASM's own ClassReader.
    • Field Summary

      Fields 
      Modifier and Type Field Description
      private org.objectweb.asm.ClassReader classReader
      The class reader that represents the class file to be read.
    • Constructor Summary

      Constructors 
      Constructor Description
      ForAsm​(org.objectweb.asm.ClassReader classReader)
      Creates a new ASM class reader that uses ASM's internal implementation.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void accept​(org.objectweb.asm.ClassVisitor classVisitor, int flags)
      Accepts a class visitor to read a class.
      java.util.List<java.lang.String> getInterfaceInternalNames()
      Returns the internal names of the represented class's interfaces.
      java.lang.String getInternalName()
      Returns the internal name of the represented class.
      int getModifiers()
      Returns the modifiers of the represented class.
      java.lang.String getSuperClassInternalName()
      Returns the internal name of the represented class's super class, or null if no such class exists.
      <T> T unwrap​(java.lang.Class<T> type)
      Unwraps a class reader to the underlying reader mechanism.
      • Methods inherited from class java.lang.Object

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

      • classReader

        private final org.objectweb.asm.ClassReader classReader
        The class reader that represents the class file to be read.
    • Constructor Detail

      • ForAsm

        public ForAsm​(org.objectweb.asm.ClassReader classReader)
        Creates a new ASM class reader that uses ASM's internal implementation.
        Parameters:
        classReader - The class reader that represents the class file to be read.
    • Method Detail

      • unwrap

        @MaybeNull
        public <T> T unwrap​(java.lang.Class<T> type)
        Unwraps a class reader to the underlying reader mechanism.
        Specified by:
        unwrap in interface AsmClassReader
        Type Parameters:
        T - The type to unwrap.
        Parameters:
        type - The type of the reader that should be unwrapped.
        Returns:
        The unwrapped instance or null if the underlying instance does not represent this type.
      • getModifiers

        public int getModifiers()
        Returns the modifiers of the represented class. The property is read, if possible, without parsing the entire class file.
        Specified by:
        getModifiers in interface AsmClassReader
        Returns:
        The modifiers of the represented class.
      • getInternalName

        public java.lang.String getInternalName()
        Returns the internal name of the represented class. The property is read, if possible, without parsing the entire class file.
        Specified by:
        getInternalName in interface AsmClassReader
        Returns:
        The internal name of the represented class.
      • getSuperClassInternalName

        public java.lang.String getSuperClassInternalName()
        Returns the internal name of the represented class's super class, or null if no such class exists. The property is read, if possible, without parsing the entire class file.
        Specified by:
        getSuperClassInternalName in interface AsmClassReader
        Returns:
        The internal name of the represented class's super class, or null if no such class exists.
      • getInterfaceInternalNames

        public java.util.List<java.lang.String> getInterfaceInternalNames()
        Returns the internal names of the represented class's interfaces. The property is read, if possible, without parsing the entire class file.
        Specified by:
        getInterfaceInternalNames in interface AsmClassReader
        Returns:
        Returns the internal names of the represented class's interfaces.
      • accept

        public void accept​(org.objectweb.asm.ClassVisitor classVisitor,
                           int flags)
        Accepts a class visitor to read a class.
        Specified by:
        accept in interface AsmClassReader
        Parameters:
        classVisitor - The class visitor who should be used as a callback for a class file.
        flags - The flags to consider while reading a class.