Class TransformationUtils

java.lang.Object
dev.nozyx.strider.loader.api.TransformationUtils

public final class TransformationUtils extends Object
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 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 - the StriderClassLoader to register the transformation with
      clazz - the fully qualified name of the class to transform
      transformation - the transformation to apply to the DynamicType.Builder