Interface ClassTransformer

All Known Implementing Classes:
BukkitCommodoreTransformer, BukkitJavaVersionCheckTransformer, FAWEConfigTransformer, FAWEReflectionUtilsTransformer, FAWEWorldEditDownloadURLTransformer, MinestomStopCleanlyTransformer, OldAsyncProfilerDisableTransformer, OldEpollDisableTransformer, PaperConfigTransformer, WorldEditJava8DetectorTransformer

public interface ClassTransformer
ClassTransformer relies on preview features of the Java platform:
  • ClassTransformer refers to one or more preview APIs: ClassTransform.
Programs can only use ClassTransformer when preview features are enabled.
Preview features may be removed in a future release, or upgraded to permanent features of the Java platform.
A transformer for a class which gets called before the class is actually put into usage. A transformer can dynamically decide if it wants to transform a class, and can be applied to multiple classes, depending on the return value of classTransformWillingness(String).
Since:
4.0
  • Method Details

    • provideClassTransform

      @NonNull @NonNull ClassTransformPREVIEW provideClassTransform()
      Provides the class transform that will be used to transform the class data. This method should only be called if a prior check to classTransformWillingness(String) did not indicate a rejection of the class.
      Returns:
      the class transform to apply to the target class.
    • classTransformWillingness

      @NonNull @NonNull ClassTransformer.TransformWillingness classTransformWillingness(@NonNull @NonNull String internalClassName)
      Checks if this class transformer is willing to transform the class with the given internal name. If this method is not returning a rejection status, the provideClassTransform()PREVIEW method is called and the transform gets applied to the target class.
      Parameters:
      internalClassName - the internal class name of the class being checked for transformation.
      Returns:
      the willingness of transformation for the class with the given name.
      Throws:
      NullPointerException - if the given internal class name is null.