Class ByteBuddyFactory

java.lang.Object
com.comphenix.protocol.utility.ByteBuddyFactory

public final class ByteBuddyFactory extends Object
Represents a shared ByteBuddy factory.
  • Constructor Details

    • ByteBuddyFactory

      public ByteBuddyFactory()
  • Method Details

    • getInstance

      public static ByteBuddyFactory getInstance()
    • getClassLoader

      public ClassLoader getClassLoader()
      Get the current class loader we are using.
      Returns:
      The current class loader.
    • setClassLoader

      public void setClassLoader(ClassLoader loader)
      Set the current class loader to use when constructing enhancers.
      Parameters:
      loader - - the class loader
    • createSubclass

      public <T> net.bytebuddy.dynamic.DynamicType.Builder.MethodDefinition.ImplementationDefinition.Optional<T> createSubclass(Class<T> clz)
      Creates a type builder for a subclass of a given Class.
      Parameters:
      clz - The class for which to create a subclass.
      Returns:
      A type builder for creating a new class extending the provided clz and implementing ByteBuddyGenerated.
    • createSubclass

      public <T> net.bytebuddy.dynamic.DynamicType.Builder.MethodDefinition.ImplementationDefinition.Optional<T> createSubclass(Class<T> clz, net.bytebuddy.dynamic.scaffold.subclass.ConstructorStrategy.Default constructorStrategy)
      Creates a type builder for a subclass of a given Class.
      Parameters:
      clz - The class for which to create a subclass.
      constructorStrategy - The constructor strategy to use.
      Returns:
      A type builder for creating a new class extending the provided clz and implementing ByteBuddyGenerated.