Class OpenedClassReader

java.lang.Object
net.bytebuddy.utility.OpenedClassReader
All Implemented Interfaces:
AsmClassReader.Factory

public class OpenedClassReader extends Object implements AsmClassReader.Factory
A factory for a ClassReader that does not apply a class file version check if the net.bytebuddy.experimental property is set.
  • Nested Class Summary

    Nested classes/interfaces inherited from interface net.bytebuddy.utility.AsmClassReader.Factory

    AsmClassReader.Factory.Default
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final int
    Indicates the ASM API version that is used throughout Byte Buddy.
    static final boolean
    true if Byte Buddy is executed in experimental mode.
    static final String
    Indicates that Byte Buddy should not validate the maximum supported class file version.
    static final String
    Indicates what processor Byte Buddy is supposed to use if no processor is configured explicitly.
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    private static <T> T
    A proxy for java.security.AccessController#doPrivileged that is activated if available.
    make(byte[] binaryRepresentation)
    Creates a class reader for a given class file.
    make(byte[] binaryRepresentation, boolean experimental)
    Creates a class reader for a given class file.
    static org.objectweb.asm.ClassReader
    of(byte[] binaryRepresentation)
    Creates a class reader for the given binary representation of a class file.
    static org.objectweb.asm.ClassReader
    of(byte[] binaryRepresentation, boolean experimental)
    Creates a class reader for the given binary representation of a class file.

    Methods inherited from class java.lang.Object

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

    • EXPERIMENTAL_PROPERTY

      public static final String EXPERIMENTAL_PROPERTY
      Indicates that Byte Buddy should not validate the maximum supported class file version.
      See Also:
    • PROCESSOR_PROPERTY

      public static final String PROCESSOR_PROPERTY
      Indicates what processor Byte Buddy is supposed to use if no processor is configured explicitly.
      See Also:
    • EXPERIMENTAL

      public static final boolean EXPERIMENTAL
      true if Byte Buddy is executed in experimental mode.
    • ASM_API

      public static final int ASM_API
      Indicates the ASM API version that is used throughout Byte Buddy.
  • Constructor Details

    • OpenedClassReader

      public OpenedClassReader()
  • Method Details

    • make

      public AsmClassReader make(byte[] binaryRepresentation)
      Creates a class reader for a given class file.
      Specified by:
      make in interface AsmClassReader.Factory
      Parameters:
      binaryRepresentation - The class file's binary representation.
      Returns:
      A class reader representation for the supplied class file.
    • make

      public AsmClassReader make(byte[] binaryRepresentation, boolean experimental)
      Creates a class reader for a given class file.
      Specified by:
      make in interface AsmClassReader.Factory
      Parameters:
      binaryRepresentation - The class file's binary representation.
      experimental - true if unknown Java class files versions should also be considered.
      Returns:
      A class reader representation for the supplied class file.
    • 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.
    • of

      public static org.objectweb.asm.ClassReader of(byte[] binaryRepresentation)
      Creates a class reader for the given binary representation of a class file.
      Parameters:
      binaryRepresentation - The binary representation of a class file to read.
      Returns:
      An appropriate class reader.
    • of

      public static org.objectweb.asm.ClassReader of(byte[] binaryRepresentation, boolean experimental)
      Creates a class reader for the given binary representation of a class file.
      Parameters:
      binaryRepresentation - The binary representation of a class file to read.
      experimental - true if unknown class file versions should also be processed.
      Returns:
      An appropriate class reader.