ASM introduction

来自WHY42
Riguz留言 | 贡献2021年4月26日 (一) 13:55的版本 →‎API structure

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 and org.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.