spring-framework / org.springframework.instrument.classloading / WeavingTransformer / transformIfNecessary

transformIfNecessary

open fun transformIfNecessary(className: String, bytes: ByteArray): ByteArray

Apply transformation on a given class byte definition. The method will always return a non-null byte array (if no transformation has taken place the array content will be identical to the original one).

Parameters

className - the full qualified name of the class in dot format (i.e. some.package.SomeClass)

bytes - class byte definition

Return
(possibly transformed) class byte definition

open fun transformIfNecessary(className: String, internalName: String, bytes: ByteArray, @Nullable pd: ProtectionDomain): ByteArray

Apply transformation on a given class byte definition. The method will always return a non-null byte array (if no transformation has taken place the array content will be identical to the original one).

Parameters

className - the full qualified name of the class in dot format (i.e. some.package.SomeClass)

internalName - class name internal name in / format (i.e. some/package/SomeClass)

bytes - class byte definition

pd - protection domain to be used (can be null)

Return
(possibly transformed) class byte definition