ClassVisitor that merges <clinit> methods into a single one. All the existing
<clinit> methods are renamed, and a new one is created, which calls all the renamed
methods.
| Modifier and Type | Field and Description |
|---|---|
| private MethodVisitor | mergedClinitVisitor
The MethodVisitor for the merged <clinit> method. |
| private int | numClinitMethods
The number of <clinit> methods visited so far. |
| private String | owner
The internal name of the visited class. |
| private final String | renamedClinitMethodPrefix
The prefix to use to rename the existing <clinit> methods. |
| Access | Constructor and Description |
|---|---|
| public | StaticInitMerger(final String
the prefix to use to rename the existing <clinit> methods. prefix, final ClassVisitor the class visitor to which this visitor must delegate method calls. May be
null. classVisitor)Constructs a new |
| protected | StaticInitMerger(final int
the ASM API version implemented by this visitor. Must be one of the api, final String ASMx values in Opcodes.the prefix to use to rename the existing <clinit> methods. prefix, final ClassVisitor the class visitor to which this visitor must delegate method calls. May be
null. classVisitor)Constructs a new |
| Modifier and Type | Method and Description |
|---|---|
| public void | visit(final int
the class version. The minor version is stored in the 16 most significant bits,
and the major version in the 16 least significant bits. version, final int the class's access flags (see access, final String Opcodes). This parameter also indicates if
the class is deprecated Opcodes#ACC_DEPRECATED or a record Opcodes#ACC_RECORD.the internal name of the class (see name, final String Type#getInternalName()).the signature of this class. May be null if the class is not a
generic one, and does not extend or implement generic classes or interfaces. signature, final String the internal of name of the super class (see superName, final String[] Type#getInternalName()).
For interfaces, the super class is Object. May be null, but only for the
Object class.the internal names of the class's interfaces (see interfaces)Type#getInternalName()). May be null.Overrides org. |
| public void | visitEnd()
Overrides org. |
| public MethodVisitor | visitMethod(final int
the method's access flags (see access, final String Opcodes). This parameter also indicates if
the method is synthetic and/or deprecated.the method's name. name, final String the method's descriptor (see descriptor, final String Type).the method's signature. May be null if the method parameters,
return type and exceptions do not use generic types. signature, final String[] the internal names of the method's exception classes (see exceptions)Type#getInternalName()). May be null.Overrides org. |
| mergedClinitVisitor | back to summary |
|---|---|
| private MethodVisitor mergedClinitVisitor The MethodVisitor for the merged <clinit> method. | |
| numClinitMethods | back to summary |
|---|---|
| private int numClinitMethods The number of <clinit> methods visited so far. | |
| owner | back to summary |
|---|---|
| private String owner The internal name of the visited class. | |
| renamedClinitMethodPrefix | back to summary |
|---|---|
| private final String renamedClinitMethodPrefix The prefix to use to rename the existing <clinit> methods. | |
| StaticInitMerger | back to summary |
|---|---|
| public StaticInitMerger(final String prefix, final ClassVisitor classVisitor) Constructs a new
| |
| StaticInitMerger | back to summary |
|---|---|
| protected StaticInitMerger(final int api, final String prefix, final ClassVisitor classVisitor) Constructs a new
| |
| visit | back to summary |
|---|---|
| public void visit(final int version, final int access, final String name, final String signature, final String superName, final String[] interfaces) Overrides org. Doc from org. Visits the header of the class.
| |
| visitEnd | back to summary |
|---|---|
| public void visitEnd() Overrides org. Doc from org. Visits the end of the class. This method, which is the last one to be called, is used to inform the visitor that all the fields and methods of the class have been visited.
| |
| visitMethod | back to summary |
|---|---|
| public MethodVisitor visitMethod(final int access, final String name, final String descriptor, final String signature, final String[] exceptions) Overrides org. Doc from org. Visits a method of the class. This method must return a new
| |