Class DynamicType.Default

java.lang.Object
net.bytebuddy.dynamic.DynamicType.AbstractBase
net.bytebuddy.dynamic.DynamicType.Default
All Implemented Interfaces:
Closeable, AutoCloseable, ClassFileLocator, DynamicType
Direct Known Subclasses:
DynamicType.Default.Loaded, DynamicType.Default.Unloaded
Enclosing interface:
DynamicType

@Enhance public static class DynamicType.Default extends DynamicType.AbstractBase
A default implementation of a dynamic type.
  • Field Details

    • typeDescription

      protected final TypeDescription typeDescription
      A type description of this dynamic type.
    • binaryRepresentation

      protected final byte[] binaryRepresentation
      The byte array representing this dynamic type.
    • loadedTypeInitializer

      protected final LoadedTypeInitializer loadedTypeInitializer
      The loaded type initializer for this dynamic type.
    • auxiliaryTypes

      protected final List<? extends DynamicType> auxiliaryTypes
      A list of auxiliary types for this dynamic type.
  • Constructor Details

    • Default

      public Default(TypeDescription typeDescription, byte[] binaryRepresentation, LoadedTypeInitializer loadedTypeInitializer, List<? extends DynamicType> auxiliaryTypes)
      Creates a new dynamic type.
      Parameters:
      typeDescription - A description of this dynamic type.
      binaryRepresentation - A byte array containing the binary representation of this dynamic type. The array must not be modified.
      loadedTypeInitializer - The loaded type initializer of this dynamic type.
      auxiliaryTypes - The auxiliary type required for this dynamic type.
  • Method Details

    • getTypeDescription

      public TypeDescription getTypeDescription()

      Returns a description of this dynamic type.

      Note: This description will most likely differ from the binary representation of this type. Normally, annotations and intercepted methods are not added to this type description.

      Returns:
      A description of this dynamic type.
    • getBytes

      public byte[] getBytes()
      Returns a byte array representing this dynamic type. This byte array might be reused by this dynamic type and must therefore not be altered.
      Returns:
      A byte array of the type's binary representation.
    • getLoadedTypeInitializer

      public LoadedTypeInitializer getLoadedTypeInitializer()
      Returns the loaded type initializer of this dynamic type.
      Returns:
      The loaded type initializer of this dynamic type.
    • getAuxiliaries

      public List<? extends DynamicType> getAuxiliaries()
      Returns all auxiliary types of this dynamic type.
      Returns:
      A list of all auxiliary types of this dynamic type.