Provides some useful class and method adapters.
Package clojure.asm.commons Description
Provides some useful class and method adapters. The preferred way of usingthese adapters is by chaining them together and to custom adapters (instead ofinheriting from them). Indeed this approach provides more combinationpossibilities than inheritance. For instance, suppose you want to implement anadapter MyAdapter than needs sorted local variables and intermediate stack mapframe values taking into account the local variables sort. By using inheritance,this would require MyAdapter to extend AnalyzerAdapter, itself extendingLocalVariablesSorter. But AnalyzerAdapter is not a subclass ofLocalVariablesSorter, so this is not possible. On the contrary, by usingdelegation, you can make LocalVariablesSorter delegate to AnalyzerAdapter,itself delegating to MyAdapter. In this case AnalyzerAdapter computesintermediate frames based on the output of LocalVariablesSorter, and MyAdaptercan add new locals by calling the newLocal method on LocalVariablesSorter, andcan get the stack map frame state before each instruction by reading the localsand stack fields in AnalyzerAdapter (this requires references from MyAdapterback to LocalVariablesSorter and AnalyzerAdapter).
Copyright © 2016. All Rights Reserved.
Launch demo modal