-
Notifications
You must be signed in to change notification settings - Fork 0
Home
Tom Martin edited this page Jul 9, 2025
·
12 revisions
At its core DASM is a java templating library that uses code not written as a template as a template.
There are two key DASM concepts, the Redirect and the Transform:
- A Redirect allows you to specify a how a method should be changed
- A Transform tells DASM to apply a set of redirects to a target
Important
DASM acts on bytecode, in which methods/fields are referenced not just by name but by their exact parameters/type.
As a result if you have a field private Foo foo;
and want to redirect it to private Bar bar;
both a
field redirect from foo
-> bar
and a type redirect from Foo
-> Bar
are required. The same applies to method names and method parameters etc.
Otherwise the bytecode will reference bar
as if it was a Foo
which makes no sense
First see this Quick Example