org.objectweb.asm.commons |
Provides some useful class and method adapters. The preferred way of using
these adapters is by chaining them together and to custom adapters (instead of
inheriting from them). Indeed this approach provides more combination
possibilities than inheritance. For instance, suppose you want to implement an
adapter MyAdapter than needs sorted local variables and intermediate stack map
frame values taking into account the local variables sort. By using inheritance,
this would require MyAdapter to extend AnalyzerAdapter, itself extending
LocalVariablesSorter. But AnalyzerAdapter is not a subclass of
LocalVariablesSorter, so this is not possible. On the contrary, by using
delegation, you can make LocalVariablesSorter delegate to AnalyzerAdapter,
itself delegating to MyAdapter. In this case AnalyzerAdapter computes
intermediate frames based on the output of LocalVariablesSorter, and MyAdapter
can add new locals by calling the newLocal method on LocalVariablesSorter, and
can get the stack map frame state before each instruction by reading the locals
and stack fields in AnalyzerAdapter (this requires references from MyAdapter
back to LocalVariablesSorter and AnalyzerAdapter).
|
Java Source File Name | Type | Comment |
AdviceAdapter.java | Class | A
org.objectweb.asm.MethodAdapter to insert before, after and around
advices in methods and constructors. |
AdviceAdapterTest.java | Class | AdviceAdapter tests. |
AdviceAdapterUnitTest.java | Class | |
AnalyzerAdapter.java | Class | A
MethodAdapter that keeps track of stack map frame changes between
AnalyzerAdapter.visitFrame(int,int,Object[],int,Object[]) visitFrame calls. |
AnalyzerAdapterTest.java | Class | AnalyzerAdapter tests. |
CodeSizeEvaluator.java | Class | A
MethodAdapter that can be used to approximate method size. |
CodeSizeEvaluatorTest.java | Class | |
EmptyVisitor.java | Class | An empty implementation of the ASM visitor interfaces. |
GASMifierClassVisitor.java | Class | Sub class of the ASMifier class visitor used to test GeneratorAdapter. |
GASMifierMethodVisitor.java | Class | A
MethodVisitor that prints the ASM code that generates the methods
it visits by using the GeneratorAdapter class. |
GASMifierTest.java | Class | GASMifier tests. |
GeneratorAdapter.java | Class | A
org.objectweb.asm.MethodAdapter with convenient methods to generate
code. |
JSRInlinerAdapter.java | Class | A
org.objectweb.asm.MethodAdapter that removes JSR instructions and
inlines the referenced subroutines. |
JSRInlinerAdapterTest.java | Class | JSRInliner tests. |
JSRInlinerAdapterUnitTest.java | Class | |
LocalVariablesSorter.java | Class | A
MethodAdapter that renumbers local variables in their order of
appearance. |
LocalVariablesSorterTest.java | Class | LocalVariableSorter tests. |
LocalVariablesSorterTest2.java | Class | LocalVariablesSorter tests. |
Method.java | Class | A named method descriptor. |
Remapper.java | Class | A class responsible for remapping types and names. |
RemappingAnnotationAdapter.java | Class | An AnnotationVisitor adapter for type remapping. |
RemappingClassAdapter.java | Class | A ClassAdapter for type remapping. |
RemappingClassAdapterTest.java | Class | |
RemappingClassAdapterTest2.java | Class | |
RemappingFieldAdapter.java | Class | A FieldVisitor adapter for type remapping. |
RemappingMethodAdapter.java | Class | A MethodAdapter for type mapping. |
RemappingSignatureAdapter.java | Class | A SignatureVisitor adapter for type mapping. |
SerialVersionUIDAdder.java | Class | A
ClassAdapter that adds a serial version unique identifier to a
class if missing. |
SerialVersionUIDAdderTest.java | Class | SerialVerionUIDAdder tests. |
SerialVersionUIDAdderUnitTest.java | Class | Test for the SerialVerionUid computation. |
SimpleRemapper.java | Class | |
StaticInitMerger.java | Class | A
ClassAdapter that merges clinit methods into a single one. |
StaticInitMergerTest.java | Class | StaticInitMerger tests. |
TableSwitchGenerator.java | Interface | A code generator for switch statements. |