Modifier and Type | Field and Description |
---|---|
protected int |
id
Identifier of the annotation visitor variable in the produced code.
|
protected Map<Label,String> |
labelNames
The label names.
|
protected String |
name
The name of the visitor variable in the produced code.
|
Modifier | Constructor and Description |
---|---|
|
ASMifier()
Constructs a new
ASMifier . |
protected |
ASMifier(int api,
String name,
int id)
Constructs a new
ASMifier . |
Modifier and Type | Method and Description |
---|---|
protected void |
appendConstant(Object cst)
Appends a string representation of the given constant to the given
buffer.
|
protected void |
appendLabel(Label l)
Appends the name of the given label to
buf . |
protected ASMifier |
createASMifier(String name,
int id) |
protected void |
declareLabel(Label l)
Appends a declaration of the given label to
buf . |
static void |
main(String[] args)
Prints the ASM source code to generate the given class to the standard
output.
|
void |
visit(int version,
int access,
String name,
String signature,
String superName,
String[] interfaces)
Class header.
|
void |
visit(String name,
Object value)
Annotation value.
|
ASMifier |
visitAnnotation(String desc,
boolean visible) |
ASMifier |
visitAnnotation(String name,
String desc)
Nested annotation value.
|
ASMifier |
visitAnnotationDefault()
Method default annotation.
|
void |
visitAnnotationEnd()
Annotation end.
|
ASMifier |
visitArray(String name)
Annotation array value.
|
void |
visitAttribute(Attribute attr) |
ASMifier |
visitClassAnnotation(String desc,
boolean visible)
Class annotation.
|
void |
visitClassAttribute(Attribute attr)
Class attribute.
|
void |
visitClassEnd()
Class end.
|
void |
visitCode()
Method start.
|
void |
visitEnum(String name,
String desc,
String value)
Annotation enum value.
|
ASMifier |
visitField(int access,
String name,
String desc,
String signature,
Object value)
Class field.
|
ASMifier |
visitFieldAnnotation(String desc,
boolean visible)
Field annotation.
|
void |
visitFieldAttribute(Attribute attr)
Field attribute.
|
void |
visitFieldEnd()
Field end.
|
void |
visitFieldInsn(int opcode,
String owner,
String name,
String desc)
Method instruction.
|
void |
visitFrame(int type,
int nLocal,
Object[] local,
int nStack,
Object[] stack)
Method stack frame.
|
void |
visitIincInsn(int var,
int increment)
Method instruction.
|
void |
visitInnerClass(String name,
String outerName,
String innerName,
int access)
Class inner name.
|
void |
visitInsn(int opcode)
Method instruction.
|
void |
visitIntInsn(int opcode,
int operand)
Method instruction.
|
void |
visitInvokeDynamicInsn(String name,
String desc,
Handle bsm,
Object... bsmArgs)
Method instruction.
|
void |
visitJumpInsn(int opcode,
Label label)
Method instruction.
|
void |
visitLabel(Label label)
Method label.
|
void |
visitLdcInsn(Object cst)
Method instruction.
|
void |
visitLineNumber(int line,
Label start)
Method debug info.
|
void |
visitLocalVariable(String name,
String desc,
String signature,
Label start,
Label end,
int index)
Method debug info.
|
void |
visitLookupSwitchInsn(Label dflt,
int[] keys,
Label[] labels)
Method instruction.
|
void |
visitMaxs(int maxStack,
int maxLocals)
Method max stack and max locals.
|
ASMifier |
visitMethod(int access,
String name,
String desc,
String signature,
String[] exceptions)
Class method.
|
ASMifier |
visitMethodAnnotation(String desc,
boolean visible)
Method annotation.
|
void |
visitMethodAttribute(Attribute attr)
Method attribute.
|
void |
visitMethodEnd()
Method end.
|
void |
visitMethodInsn(int opcode,
String owner,
String name,
String desc)
Method instruction.
|
void |
visitMultiANewArrayInsn(String desc,
int dims)
Method instruction.
|
void |
visitOuterClass(String owner,
String name,
String desc)
Class outer class.
|
ASMifier |
visitParameterAnnotation(int parameter,
String desc,
boolean visible)
Method parameter annotation.
|
void |
visitSource(String file,
String debug)
Class source.
|
void |
visitTableSwitchInsn(int min,
int max,
Label dflt,
Label... labels)
Method instruction.
|
void |
visitTryCatchBlock(Label start,
Label end,
Label handler,
String type)
Method exception handler.
|
void |
visitTypeInsn(int opcode,
String type)
Method instruction.
|
void |
visitVarInsn(int opcode,
int var)
Method instruction.
|
appendString, getText, print
protected final String name
protected final int id
public ASMifier()
ASMifier
. Subclasses must not use this
constructor. Instead, they must use the
ASMifier(int, String, int)
version.protected ASMifier(int api, String name, int id)
ASMifier
.api
- the ASM API version implemented by this class. Must be one of
Opcodes.ASM4
.name
- the name of the visitor variable in the produced code.id
- identifier of the annotation visitor variable in the produced
code.public static void main(String[] args) throws Exception
Usage: ASMifier [-debug] <binary class name or class file name>
args
- the command line arguments.Exception
- if the class cannot be found, or if an IO exception occurs.public void visit(int version, int access, String name, String signature, String superName, String[] interfaces)
Printer
public void visitSource(String file, String debug)
Printer
ClassVisitor.visitSource(java.lang.String, java.lang.String)
.visitSource
in class Printer
public void visitOuterClass(String owner, String name, String desc)
Printer
ClassVisitor.visitOuterClass(java.lang.String, java.lang.String, java.lang.String)
.visitOuterClass
in class Printer
public ASMifier visitClassAnnotation(String desc, boolean visible)
Printer
ClassVisitor.visitAnnotation(java.lang.String, boolean)
.visitClassAnnotation
in class Printer
public void visitClassAttribute(Attribute attr)
Printer
ClassVisitor.visitAttribute(com.google.gwt.dev.asm.Attribute)
.visitClassAttribute
in class Printer
public void visitInnerClass(String name, String outerName, String innerName, int access)
Printer
ClassVisitor.visitInnerClass(java.lang.String, java.lang.String, java.lang.String, int)
.visitInnerClass
in class Printer
public ASMifier visitField(int access, String name, String desc, String signature, Object value)
Printer
ClassVisitor.visitField(int, java.lang.String, java.lang.String, java.lang.String, java.lang.Object)
.visitField
in class Printer
public ASMifier visitMethod(int access, String name, String desc, String signature, String[] exceptions)
Printer
ClassVisitor.visitMethod(int, java.lang.String, java.lang.String, java.lang.String, java.lang.String[])
.visitMethod
in class Printer
public void visitClassEnd()
Printer
ClassVisitor.visitEnd()
.visitClassEnd
in class Printer
public void visit(String name, Object value)
Printer
AnnotationVisitor.visit(java.lang.String, java.lang.Object)
.public void visitEnum(String name, String desc, String value)
Printer
AnnotationVisitor.visitEnum(java.lang.String, java.lang.String, java.lang.String)
.public ASMifier visitAnnotation(String name, String desc)
Printer
AnnotationVisitor.visitAnnotation(java.lang.String, java.lang.String)
.visitAnnotation
in class Printer
public ASMifier visitArray(String name)
Printer
AnnotationVisitor.visitArray(java.lang.String)
.visitArray
in class Printer
public void visitAnnotationEnd()
Printer
AnnotationVisitor.visitEnd()
.visitAnnotationEnd
in class Printer
public ASMifier visitFieldAnnotation(String desc, boolean visible)
Printer
FieldVisitor.visitAnnotation(java.lang.String, boolean)
.visitFieldAnnotation
in class Printer
public void visitFieldAttribute(Attribute attr)
Printer
FieldVisitor.visitAttribute(com.google.gwt.dev.asm.Attribute)
.visitFieldAttribute
in class Printer
public void visitFieldEnd()
Printer
FieldVisitor.visitEnd()
.visitFieldEnd
in class Printer
public ASMifier visitAnnotationDefault()
Printer
MethodVisitor.visitAnnotationDefault()
.visitAnnotationDefault
in class Printer
public ASMifier visitMethodAnnotation(String desc, boolean visible)
Printer
MethodVisitor.visitAnnotation(java.lang.String, boolean)
.visitMethodAnnotation
in class Printer
public ASMifier visitParameterAnnotation(int parameter, String desc, boolean visible)
Printer
MethodVisitor.visitParameterAnnotation(int, java.lang.String, boolean)
.visitParameterAnnotation
in class Printer
public void visitMethodAttribute(Attribute attr)
Printer
MethodVisitor.visitAttribute(com.google.gwt.dev.asm.Attribute)
.visitMethodAttribute
in class Printer
public void visitCode()
Printer
MethodVisitor.visitCode()
.public void visitFrame(int type, int nLocal, Object[] local, int nStack, Object[] stack)
Printer
MethodVisitor.visitFrame(int, int, java.lang.Object[], int, java.lang.Object[])
.visitFrame
in class Printer
public void visitInsn(int opcode)
Printer
MethodVisitor.visitInsn(int)
.public void visitIntInsn(int opcode, int operand)
Printer
MethodVisitor.visitIntInsn(int, int)
.visitIntInsn
in class Printer
public void visitVarInsn(int opcode, int var)
Printer
MethodVisitor.visitVarInsn(int, int)
.visitVarInsn
in class Printer
public void visitTypeInsn(int opcode, String type)
Printer
MethodVisitor.visitTypeInsn(int, java.lang.String)
.visitTypeInsn
in class Printer
public void visitFieldInsn(int opcode, String owner, String name, String desc)
Printer
MethodVisitor.visitFieldInsn(int, java.lang.String, java.lang.String, java.lang.String)
.visitFieldInsn
in class Printer
public void visitMethodInsn(int opcode, String owner, String name, String desc)
Printer
MethodVisitor.visitMethodInsn(int, java.lang.String, java.lang.String, java.lang.String)
.visitMethodInsn
in class Printer
public void visitInvokeDynamicInsn(String name, String desc, Handle bsm, Object... bsmArgs)
Printer
MethodVisitor.visitInvokeDynamicInsn(java.lang.String, java.lang.String, com.google.gwt.dev.asm.Handle, java.lang.Object...)
.visitInvokeDynamicInsn
in class Printer
public void visitJumpInsn(int opcode, Label label)
Printer
MethodVisitor.visitJumpInsn(int, com.google.gwt.dev.asm.Label)
.visitJumpInsn
in class Printer
public void visitLabel(Label label)
Printer
MethodVisitor.visitLabel(com.google.gwt.dev.asm.Label)
.visitLabel
in class Printer
public void visitLdcInsn(Object cst)
Printer
MethodVisitor.visitLdcInsn(java.lang.Object)
.visitLdcInsn
in class Printer
public void visitIincInsn(int var, int increment)
Printer
MethodVisitor.visitIincInsn(int, int)
.visitIincInsn
in class Printer
public void visitTableSwitchInsn(int min, int max, Label dflt, Label... labels)
Printer
MethodVisitor.visitTableSwitchInsn(int, int, com.google.gwt.dev.asm.Label, com.google.gwt.dev.asm.Label...)
.visitTableSwitchInsn
in class Printer
public void visitLookupSwitchInsn(Label dflt, int[] keys, Label[] labels)
Printer
MethodVisitor.visitLookupSwitchInsn(com.google.gwt.dev.asm.Label, int[], com.google.gwt.dev.asm.Label[])
.visitLookupSwitchInsn
in class Printer
public void visitMultiANewArrayInsn(String desc, int dims)
Printer
MethodVisitor.visitMultiANewArrayInsn(java.lang.String, int)
.visitMultiANewArrayInsn
in class Printer
public void visitTryCatchBlock(Label start, Label end, Label handler, String type)
Printer
MethodVisitor.visitTryCatchBlock(com.google.gwt.dev.asm.Label, com.google.gwt.dev.asm.Label, com.google.gwt.dev.asm.Label, java.lang.String)
.visitTryCatchBlock
in class Printer
public void visitLocalVariable(String name, String desc, String signature, Label start, Label end, int index)
Printer
MethodVisitor.visitLocalVariable(java.lang.String, java.lang.String, java.lang.String, com.google.gwt.dev.asm.Label, com.google.gwt.dev.asm.Label, int)
.visitLocalVariable
in class Printer
public void visitLineNumber(int line, Label start)
Printer
MethodVisitor.visitLineNumber(int, com.google.gwt.dev.asm.Label)
.visitLineNumber
in class Printer
public void visitMaxs(int maxStack, int maxLocals)
Printer
MethodVisitor.visitMaxs(int, int)
.public void visitMethodEnd()
Printer
MethodVisitor.visitEnd()
.visitMethodEnd
in class Printer
public void visitAttribute(Attribute attr)
protected void appendConstant(Object cst)
protected void declareLabel(Label l)
buf
. This
declaration is of the form "Label lXXX = new Label();". Does nothing if
the given label has already been declared.l
- a label.Copyright © 2018. All rights reserved.