Top Description Interfaces Classes
module org.objectweb.asm.commons

Package 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).

Interface Summary

Modifier and TypeInterface and Description
public interface
TableSwitchGenerator

A code generator for switch statements.

Class Summary

Modifier and TypeClass and Description
public abstract class
AdviceAdapter

A MethodVisitor to insert before, after and around advices in methods and constructors.

public class
AnalyzerAdapter

A MethodVisitor that keeps track of stack map frame changes between visitFrame(int, int, Object[], int, Object[]) calls.

public class
AnnotationRemapper

An AnnotationVisitor that remaps types with a Remapper.

public class
ClassRemapper

A ClassVisitor that remaps types with a Remapper.

public class
CodeSizeEvaluator

A MethodVisitor that approximates the size of the methods it visits.

public class
FieldRemapper

A FieldVisitor that remaps types with a Remapper.

public class
GeneratorAdapter

A MethodVisitor with convenient methods to generate code.

public class
InstructionAdapter

A MethodVisitor providing a more detailed API to generate and transform instructions.

public class
JSRInlinerAdapter

A org.objectweb.asm.MethodVisitor that removes JSR instructions and inlines the referenced subroutines.

public class
LocalVariablesSorter

A MethodVisitor that renumbers local variables in their order of appearance.

public class
Method

A named method descriptor.

public class
MethodRemapper

A MethodVisitor that remaps types with a Remapper.

public class
ModuleHashesAttribute

A ModuleHashes attribute.

public class
ModuleRemapper

A ModuleVisitor that remaps types with a Remapper.

public class
ModuleResolutionAttribute

A ModuleResolution attribute.

public class
ModuleTargetAttribute

A ModuleTarget attribute.

public class
public abstract class
Remapper

A class responsible for remapping types and names.

public class
SerialVersionUIDAdder

A ClassVisitor that adds a serial version unique identifier to a class if missing.

public class
SignatureRemapper

A SignatureVisitor that remaps types with a Remapper.

public class
SimpleRemapper

A Remapper using a Map to define its mapping.

public class
StaticInitMerger

A ClassVisitor that merges <clinit> methods into a single one.

public class
TryCatchBlockSorter

A MethodVisitor adapter to sort the exception handlers.