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:
ClassTransformerrefers to one or more preview APIs:ClassTransform.
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
-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic enumThe acceptance states of a class transformer for a given class. -
Method Summary
Modifier and TypeMethodDescriptionclassTransformWillingness(@NonNull String internalClassName) Checks if this class transformer is willing to transform the class with the given internal name.Provides the class transform that will be used to transform the class data.
-
Method Details
-
provideClassTransform
Provides the class transform that will be used to transform the class data. This method should only be called if a prior check toclassTransformWillingness(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, theprovideClassTransform()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.
-
ClassTransformerwhen preview features are enabled.