Class AsmClassReader.ForClassFileApi

java.lang.Object
net.bytebuddy.utility.AsmClassReader.ForClassFileApi
All Implemented Interfaces:
AsmClassReader
Enclosing interface:
AsmClassReader

@Enhance public static class AsmClassReader.ForClassFileApi extends Object implements AsmClassReader
A class reader that is based upon the Class File API.
  • Field Details

    • DISPATCHER

      protected static final AsmClassReader.ForClassFileApi.JdkClassReader DISPATCHER
      A dispatcher to interact with codes.rafael.asmjdkbridge.JdkClassReader.
    • classReader

      private final Object classReader
      The class reader that represents the class file to be read.
  • Constructor Details

    • ForClassFileApi

      public ForClassFileApi(Object classReader)
      Creates a new class reader that is based upon the Class File API.
      Parameters:
      classReader - The class reader that represents the class file to be read.
  • Method Details

    • doPrivileged

      @Enhance private static <T> T doPrivileged(PrivilegedAction<T> action)
      A proxy for java.security.AccessController#doPrivileged that is activated if available.
      Type Parameters:
      T - The type of the action's resolved value.
      Parameters:
      action - The action to execute from a privileged context.
      Returns:
      The action's resolved value.
    • unwrap

      @MaybeNull public <T> T unwrap(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 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

      @MaybeNull public 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 List<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.
    • getSuperClassName

      @MaybeNull public String getSuperClassName()
    • getInterfaceTypeName

      @MaybeNull public String[] getInterfaceTypeName()
    • 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.