Package org.objectweb.asm.commons
Class StaticInitMerger
java.lang.Object
org.objectweb.asm.ClassVisitor
org.objectweb.asm.commons.StaticInitMerger
public class StaticInitMerger
extends org.objectweb.asm.ClassVisitor
A
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.-
Field Summary
Fields inherited from class org.objectweb.asm.ClassVisitor
api, cv
-
Constructor Summary
ConstructorsModifierConstructorDescriptionprotected
StaticInitMerger
(int api, String prefix, org.objectweb.asm.ClassVisitor classVisitor) Constructs a newStaticInitMerger
.StaticInitMerger
(String prefix, org.objectweb.asm.ClassVisitor classVisitor) Constructs a newStaticInitMerger
. -
Method Summary
Methods inherited from class org.objectweb.asm.ClassVisitor
getDelegate, visitAnnotation, visitAttribute, visitField, visitInnerClass, visitModule, visitNestHost, visitNestMember, visitOuterClass, visitPermittedSubclass, visitRecordComponent, visitSource, visitTypeAnnotation
-
Constructor Details
-
StaticInitMerger
Constructs a newStaticInitMerger
. Subclasses must not use this constructor. Instead, they must use theStaticInitMerger(int, String, ClassVisitor)
version.- Parameters:
prefix
- the prefix to use to rename the existing <clinit> methods.classVisitor
- the class visitor to which this visitor must delegate method calls. May be null.
-
StaticInitMerger
Constructs a newStaticInitMerger
.- Parameters:
api
- the ASM API version implemented by this visitor. Must be one of theASM
x values inOpcodes
.prefix
- the prefix to use to rename the existing <clinit> methods.classVisitor
- the class visitor to which this visitor must delegate method calls. May be null.
-
-
Method Details
-
visit
public void visit(int version, int access, String name, String signature, String superName, String[] interfaces) - Overrides:
visit
in classorg.objectweb.asm.ClassVisitor
-
visitMethod
public org.objectweb.asm.MethodVisitor visitMethod(int access, String name, String descriptor, String signature, String[] exceptions) - Overrides:
visitMethod
in classorg.objectweb.asm.ClassVisitor
-
visitEnd
public void visitEnd()- Overrides:
visitEnd
in classorg.objectweb.asm.ClassVisitor
-