Class JdkClassReader

java.lang.Object
codes.rafael.asmjdkbridge.JdkClassReader

public class JdkClassReader extends Object
A reader for class files that uses the JDK class file API. The created class reader is immutable.
  • Constructor Summary

    Constructors
    Constructor
    Description
    JdkClassReader(byte[] classFile, org.objectweb.asm.Attribute... attributePrototypes)
    Creates a new class reader.
    JdkClassReader(InputStream inputStream, org.objectweb.asm.Attribute... attributePrototypes)
    Creates a new class reader.
    JdkClassReader(String className, org.objectweb.asm.Attribute... attributePrototypes)
    Creates a new class reader.
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    accept(org.objectweb.asm.ClassVisitor classVisitor, int flags)
    Accepts a class visitor for the represented class file.

    Methods inherited from class Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • JdkClassReader

      public JdkClassReader(byte[] classFile, org.objectweb.asm.Attribute... attributePrototypes)
      Creates a new class reader.
      Parameters:
      classFile - The class file to represent.
      attributePrototypes - Prototypes of ASM attributes to map if discovered.
    • JdkClassReader

      public JdkClassReader(InputStream inputStream, org.objectweb.asm.Attribute... attributePrototypes) throws IOException
      Creates a new class reader.
      Parameters:
      inputStream - An input stream of the class file to represent.
      attributePrototypes - Prototypes of ASM attributes to map if discovered.
      Throws:
      IOException - If the stream cannot be read.
    • JdkClassReader

      public JdkClassReader(String className, org.objectweb.asm.Attribute... attributePrototypes) throws IOException
      Creates a new class reader.
      Parameters:
      className - The name of the class to represent. The class must be resolvable from the system loader.
      attributePrototypes - Prototypes of ASM attributes to map if discovered.
      Throws:
      IOException - If the class file cannot be read.
  • Method Details

    • accept

      public void accept(org.objectweb.asm.ClassVisitor classVisitor, int flags)
      Accepts a class visitor for the represented class file.
      Parameters:
      classVisitor - The class visitor to delegate calls to.
      flags - The ASM flags to consider when visiting the class file.