Class ByteBuddyPatchRegistry
java.lang.Object
me.tamkungz.nilkit.tooling.bytebuddy.ByteBuddyPatchRegistry
Composes and installs
ByteBuddyPatch instances.
Two execution paths are supported:
- NilLoader pre-load transformation, requiring no self-attach.
- Instrumentation/AgentBuilder with retransformation for already loaded classes.
This makes the same patch definition usable both like a traditional Mixin (before class definition) and like a runtime agent when Instrumentation exists.
-
Nested Class Summary
Nested Classes -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidclear()voidInstalls one catch-all NilLoader transformer.installOn(Instrumentation instrumentation) Installs all registered patches as one retransformation-capable Byte Buddy agent.booleanisEmpty()register(ByteBuddyPatch patch) snapshot()byte[]transformBytes(ClassLoader loader, String binaryClassName, byte[] originalBytes) Transforms a raw class file without loading the class.booleanunregister(String id)
-
Constructor Details
-
ByteBuddyPatchRegistry
public ByteBuddyPatchRegistry()
-
-
Method Details
-
register
-
unregister
-
clear
public void clear() -
snapshot
-
isEmpty
public boolean isEmpty() -
installNilLoaderBridge
public void installNilLoaderBridge()Installs one catch-all NilLoader transformer. Register this during premain/hijack, before NilLoader closes transformer registration.Patches themselves remain dynamic: a patch registered later still affects classes that have not yet been defined.
-
transformBytes
Transforms a raw class file without loading the class. Useful for NilLoader and for tests/tools that patch byte arrays directly. -
installOn
Installs all registered patches as one retransformation-capable Byte Buddy agent. The returned handle can later be reset.
-