Class TransformationUtils
java.lang.Object
dev.nozyx.strider.loader.api.TransformationUtils
Provides utility methods for transforming classes using ByteBuddy.
This class provides a simplified API for applying straightforward
transformations to a class or its members without requiring the more
complex configuration of a ClassTransformer.
-
Method Summary
Modifier and TypeMethodDescriptionstatic voidtransformClass(StriderClassLoader classLoader, String clazz, UnaryOperator<net.bytebuddy.dynamic.DynamicType.Builder<?>> transformation) Applies a ByteBuddy transformation to a specific class.
-
Method Details
-
transformClass
public static void transformClass(StriderClassLoader classLoader, String clazz, UnaryOperator<net.bytebuddy.dynamic.DynamicType.Builder<?>> transformation) Applies a ByteBuddy transformation to a specific class.The transformation can modify the class itself or any of its members, such as methods and fields. This provides a convenient way to perform common transformations without requiring a custom
ClassTransformer.- Parameters:
classLoader- theStriderClassLoaderto register the transformation withclazz- the fully qualified name of the class to transformtransformation- the transformation to apply to theDynamicType.Builder
-