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…」的新頁面 |
|||
第4行: | 第4行: | ||
= API structure = | = API structure = | ||
* <syntaxhighlight lang="java" inline>org.objectweb.asm</syntaxhighlight> and <syntaxhighlight lang="java" inline>org.objectweb.asm.signature</syntaxhighlight>: packages define the event based API and provide the class parser and writer com- ponents. They are contained in the asm.jar archive. | |||
[[Category:JVM]] | [[Category:JVM]] | ||
[[Category:ASM]] | [[Category:ASM]] |
2021年4月26日 (一) 13:55的版本
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.