Package com.comphenix.protocol.utility
Class ByteBuddyFactory
java.lang.Object
com.comphenix.protocol.utility.ByteBuddyFactory
Represents a shared ByteBuddy factory.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescription<T> net.bytebuddy.dynamic.DynamicType.Builder.MethodDefinition.ImplementationDefinition.Optional<T> createSubclass(Class<T> clz) Creates a type builder for a subclass of a givenClass.<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 givenClass.Get the current class loader we are using.static ByteBuddyFactoryvoidsetClassLoader(ClassLoader loader) Set the current class loader to use when constructing enhancers.
-
Constructor Details
-
ByteBuddyFactory
public ByteBuddyFactory()
-
-
Method Details
-
getInstance
-
getClassLoader
Get the current class loader we are using.- Returns:
- The current class loader.
-
setClassLoader
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 givenClass.- 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 givenClass.- 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.
-