ASM introduction
Event based API vs Tree API
- The event based API is faster and requires less memory than the object based API, since there is no need to create and store in memory a tree of objects representing the class (the same difference also exists between SAX and DOM).
- However implementing class transformations can be more difficult with the event based API, since only one element of the class is available at any given time (the element that corresponds to the current event), while the whole class is available in memory with the object based API.
API structure
org.objectweb.asm
andorg.objectweb.asm.signature
: packages define the event based API and provide the class parser and writer com- ponents. They are contained in the asm.jar archive.