Class ProbingClassWriter

java.lang.Object
org.objectweb.asm.ClassVisitor
codes.rafael.asmjdkbridge.ProbingClassWriter

public class ProbingClassWriter extends org.objectweb.asm.ClassVisitor
A class writer that automatically resolves a suitable writer, either based on ASM (if ASM officially supports a class file version) or a JDK Class File API based implementation.
  • Field Summary

    Fields inherited from class org.objectweb.asm.ClassVisitor

    api, cv
  • Constructor Summary

    Constructors
    Constructor
    Description
    ProbingClassWriter(int flags)
    Creates a class writer.
    ProbingClassWriter(int flags, Method getSuperClass, Object target)
    Creates a class writer.
    ProbingClassWriter(int flags, Function<String,String> getSuperClass)
    Creates a class writer.
  • Method Summary

    Modifier and Type
    Method
    Description
    byte[]
    Returns the generated class file.
    void
    visit(int version, int access, String name, String signature, String superName, String[] interfaces)
     

    Methods inherited from class org.objectweb.asm.ClassVisitor

    getDelegate, visitAnnotation, visitAttribute, visitEnd, visitField, visitInnerClass, visitMethod, visitModule, visitNestHost, visitNestMember, visitOuterClass, visitPermittedSubclass, visitRecordComponent, visitSource, visitTypeAnnotation

    Methods inherited from class Object

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

    • ProbingClassWriter

      public ProbingClassWriter(int flags)
      Creates a class writer.
      Parameters:
      flags - The ASM flags to consider.
    • ProbingClassWriter

      public ProbingClassWriter(int flags, Method getSuperClass, Object target)
      Creates a class writer.
      Parameters:
      flags - The ASM flags to consider.
      getSuperClass - A resolver for the supplied internal class name's internal super class name. If a class is an interface, null should be returned. As a method to allow pre-Java 8 code to call this constructor via reflection.
      target - The target to invoke the reflective method on.
    • ProbingClassWriter

      public ProbingClassWriter(int flags, Function<String,String> getSuperClass)
      Creates a class writer.
      Parameters:
      flags - The ASM flags to consider.
      getSuperClass - A resolver for the supplied internal class name's internal super class name. If a class is an interface, null should be returned.
  • Method Details

    • visit

      public void visit(int version, int access, String name, String signature, String superName, String[] interfaces)
      Overrides:
      visit in class org.objectweb.asm.ClassVisitor
    • toByteArray

      public byte[] toByteArray()
      Returns the generated class file.
      Returns:
      The class file as a byte array.