injectConstructorBefore

fun injectConstructorBefore(targetClassName: String, parameterTypeNames: List<String> = emptyList(), owner: String? = null, handler: (UnsafeConstructorInvocationContext) -> Unit): UnsafeHandle

Injects a callback before constructor execution (string-based overload).

Return

injection handle, usable by rollbackUnsafe

Parameters

targetClassName

target class fully-qualified name

parameterTypeNames

constructor parameter type names, e.g. int, java.lang.String

owner

script owner (nullable, auto-resolved from script context if null)

handler

constructor-before callback


Injects a callback before constructor execution (Constructor overload).