Class FAWEConfigTransformer
java.lang.Object
eu.cloudnetservice.wrapper.transform.bukkit.FAWEConfigTransformer
- All Implemented Interfaces:
ClassTransformer
FAWEConfigTransformer relies on preview features of the Java platform:
FAWEConfigTransformerrefers 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 implementation that disables the
setAccessible method in the FAWE Config on old FAWE versions.
This is due to the fact that the method uses illegal reflection in the attempt to set a final field which is not
possible anymore on newer java versions.-
Nested Class Summary
Nested classes/interfaces inherited from interface eu.cloudnetservice.wrapper.transform.ClassTransformer
ClassTransformer.TransformWillingness -
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionConstructs a new instance of this transformer, usually done via SPI. -
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.
-
Field Details
-
CNI_CONFIG
- See Also:
-
MN_SET_ACCESSIBLE
- See Also:
-
-
Constructor Details
-
FAWEConfigTransformer
public FAWEConfigTransformer()Constructs a new instance of this transformer, usually done via SPI.
-
-
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 toClassTransformer.classTransformWillingness(String)did not indicate a rejection of the class.- Specified by:
provideClassTransformin interfaceClassTransformer- Returns:
- the class transform to apply to the target class.
-
classTransformWillingness
@NonNull public @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, theClassTransformer.provideClassTransform()PREVIEW method is called and the transform gets applied to the target class.- Specified by:
classTransformWillingnessin interfaceClassTransformer- 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.
-
FAWEConfigTransformerwhen preview features are enabled.