类 ASMifier
java.lang.Object
org.beetl.ow2.asm.util.Printer
org.beetl.ow2.asm.util.ASMifier
A
Printer that prints the ASM code to generate the classes if visits.- 作者:
- Eric Bruneton
-
字段概要
字段修饰符和类型字段说明protected final intIdentifier of the annotation visitor variable in the produced code.The label names.protected final StringThe className of the visitor variable in the produced code. -
构造器概要
构造器 -
方法概要
修饰符和类型方法说明protected voidappendConstant(Object cst) Appends a string representation of the given constant to the given buffer.protected voidappendLabel(Label l) Appends the className of the given label tobuf.protected ASMifiercreateASMifier(String name, int id) protected voidAppends a declaration of the given label tobuf.static voidPrints the ASM srccode code to generate the given class to the standard output.voidvisit(int version, int access, String name, String signature, String superName, String[] interfaces) Class header.voidAnnotation value.visitAnnotation(String desc, boolean visible) visitAnnotation(String name, String desc) Nested annotation value.Method default annotation.voidAnnotation end.visitArray(String name) Annotation array value.voidvisitAttribute(Attribute attr) visitClassAnnotation(String desc, boolean visible) Class annotation.voidvisitClassAttribute(Attribute attr) Class attribute.voidClass end.visitClassTypeAnnotation(int typeRef, TypePath typePath, String desc, boolean visible) Class type annotation.voidMethod start.voidAnnotation enum value.visitField(int access, String name, String desc, String signature, Object value) Class field.visitFieldAnnotation(String desc, boolean visible) Field annotation.voidvisitFieldAttribute(Attribute attr) Field attribute.voidField end.voidvisitFieldInsn(int opcode, String owner, String name, String desc) Method instruction.visitFieldTypeAnnotation(int typeRef, TypePath typePath, String desc, boolean visible) Field type annotation.voidvisitFrame(int type, int nLocal, Object[] local, int nStack, Object[] stack) Method stack frame.voidvisitIincInsn(int var, int increment) Method instruction.voidvisitInnerClass(String name, String outerName, String innerName, int access) Class inner className.voidvisitInsn(int opcode) Method instruction.visitInsnAnnotation(int typeRef, TypePath typePath, String desc, boolean visible) Instruction type annotation.voidvisitIntInsn(int opcode, int operand) Method instruction.voidvisitInvokeDynamicInsn(String name, String desc, Handle bsm, Object... bsmArgs) Method instruction.voidvisitJumpInsn(int opcode, Label label) Method instruction.voidvisitLabel(Label label) Method label.voidvisitLdcInsn(Object cst) Method instruction.voidvisitLineNumber(int line, Label start) Method debug info.voidMethod debug info.visitLocalVariableAnnotation(int typeRef, TypePath typePath, Label[] start, Label[] end, int[] index, String desc, boolean visible) Local variable type annotation.voidvisitLookupSwitchInsn(Label dflt, int[] keys, Label[] labels) Method instruction.voidvisitMaxs(int maxStack, int maxLocals) Method max stack and max locals.visitMethod(int access, String name, String desc, String signature, String[] exceptions) Class method.visitMethodAnnotation(String desc, boolean visible) Method annotation.voidMethod attribute.voidMethod end.voidvisitMethodInsn(int opcode, String owner, String name, String desc) 已过时。voidvisitMethodInsn(int opcode, String owner, String name, String desc, boolean itf) Method instruction.visitMethodTypeAnnotation(int typeRef, TypePath typePath, String desc, boolean visible) Method type annotation.voidvisitMultiANewArrayInsn(String desc, int dims) Method instruction.voidvisitOuterClass(String owner, String name, String desc) Class outer class.voidvisitParameter(String parameterName, int access) Method parameter.visitParameterAnnotation(int parameter, String desc, boolean visible) Method parameter annotation.voidvisitSource(String file, String debug) Class srccode.voidvisitTableSwitchInsn(int min, int max, Label dflt, Label... labels) Method instruction.visitTryCatchAnnotation(int typeRef, TypePath typePath, String desc, boolean visible) Try catch block type annotation.voidvisitTryCatchBlock(Label start, Label end, Label handler, String type) Method exception handler.visitTypeAnnotation(int typeRef, TypePath typePath, String desc, boolean visible) visitTypeAnnotation(String method, int typeRef, TypePath typePath, String desc, boolean visible) voidvisitTypeInsn(int opcode, String type) Method instruction.voidvisitVarInsn(int opcode, int var) Method instruction.从类继承的方法 org.beetl.ow2.asm.util.Printer
appendString, getText, print
-
字段详细资料
-
name
The className of the visitor variable in the produced code. -
id
protected final int idIdentifier of the annotation visitor variable in the produced code. -
labelNames
The label names. This map associates String values to Label keys. It is used only in ASMifierMethodVisitor.
-
-
构造器详细资料
-
ASMifier
public ASMifier()Constructs a newASMifier. Subclasses must not use this constructor. Instead, they must use theASMifier(int, String, int)version.- 抛出:
IllegalStateException- If a subclass calls this constructor.
-
ASMifier
Constructs a newASMifier.- 参数:
api- the ASM API version implemented by this class. Must be one ofOpcodes.ASM4orOpcodes.ASM5.name- the className of the visitor variable in the produced code.id- identifier of the annotation visitor variable in the produced code.
-
-
方法详细资料
-
main
Prints the ASM srccode code to generate the given class to the standard output.Usage: ASMifier [-debug] <binary class className or class file className>
- 参数:
args- the command line arguments.- 抛出:
Exception- if the class cannot be found, or if an IO exception occurs.
-
visit
public void visit(int version, int access, String name, String signature, String superName, String[] interfaces) 从类复制的说明:Printer -
visitSource
从类复制的说明:PrinterClass srccode. SeeClassVisitor.visitSource(java.lang.String, java.lang.String).- 指定者:
visitSource在类中Printer
-
visitOuterClass
从类复制的说明:PrinterClass outer class. SeeClassVisitor.visitOuterClass(java.lang.String, java.lang.String, java.lang.String).- 指定者:
visitOuterClass在类中Printer
-
visitClassAnnotation
从类复制的说明:PrinterClass annotation. SeeClassVisitor.visitAnnotation(java.lang.String, boolean).- 指定者:
visitClassAnnotation在类中Printer
-
visitClassTypeAnnotation
public ASMifier visitClassTypeAnnotation(int typeRef, TypePath typePath, String desc, boolean visible) 从类复制的说明:PrinterClass type annotation. SeeClassVisitor.visitTypeAnnotation(int, org.beetl.ow2.asm.TypePath, java.lang.String, boolean).- 覆盖:
visitClassTypeAnnotation在类中Printer
-
visitClassAttribute
从类复制的说明:PrinterClass attribute. SeeClassVisitor.visitAttribute(org.beetl.ow2.asm.Attribute).- 指定者:
visitClassAttribute在类中Printer
-
visitInnerClass
从类复制的说明:PrinterClass inner className. SeeClassVisitor.visitInnerClass(java.lang.String, java.lang.String, java.lang.String, int).- 指定者:
visitInnerClass在类中Printer
-
visitField
从类复制的说明:PrinterClass field. SeeClassVisitor.visitField(int, java.lang.String, java.lang.String, java.lang.String, java.lang.Object).- 指定者:
visitField在类中Printer
-
visitMethod
public ASMifier visitMethod(int access, String name, String desc, String signature, String[] exceptions) 从类复制的说明:PrinterClass method. SeeClassVisitor.visitMethod(int, java.lang.String, java.lang.String, java.lang.String, java.lang.String[]).- 指定者:
visitMethod在类中Printer
-
visitClassEnd
public void visitClassEnd()从类复制的说明:PrinterClass end. SeeClassVisitor.visitEnd().- 指定者:
visitClassEnd在类中Printer
-
visit
从类复制的说明:PrinterAnnotation value. SeeAnnotationVisitor.visit(java.lang.String, java.lang.Object). -
visitEnum
从类复制的说明:PrinterAnnotation enum value. SeeAnnotationVisitor.visitEnum(java.lang.String, java.lang.String, java.lang.String). -
visitAnnotation
从类复制的说明:PrinterNested annotation value. SeeAnnotationVisitor.visitAnnotation(java.lang.String, java.lang.String).- 指定者:
visitAnnotation在类中Printer
-
visitArray
从类复制的说明:PrinterAnnotation array value. SeeAnnotationVisitor.visitArray(java.lang.String).- 指定者:
visitArray在类中Printer
-
visitAnnotationEnd
public void visitAnnotationEnd()从类复制的说明:PrinterAnnotation end. SeeAnnotationVisitor.visitEnd().- 指定者:
visitAnnotationEnd在类中Printer
-
visitFieldAnnotation
从类复制的说明:PrinterField annotation. SeeFieldVisitor.visitAnnotation(java.lang.String, boolean).- 指定者:
visitFieldAnnotation在类中Printer
-
visitFieldTypeAnnotation
public ASMifier visitFieldTypeAnnotation(int typeRef, TypePath typePath, String desc, boolean visible) 从类复制的说明:PrinterField type annotation. SeeFieldVisitor.visitTypeAnnotation(int, org.beetl.ow2.asm.TypePath, java.lang.String, boolean).- 覆盖:
visitFieldTypeAnnotation在类中Printer
-
visitFieldAttribute
从类复制的说明:PrinterField attribute. SeeFieldVisitor.visitAttribute(org.beetl.ow2.asm.Attribute).- 指定者:
visitFieldAttribute在类中Printer
-
visitFieldEnd
public void visitFieldEnd()从类复制的说明:PrinterField end. SeeFieldVisitor.visitEnd().- 指定者:
visitFieldEnd在类中Printer
-
visitParameter
从类复制的说明:PrinterMethod parameter. SeeMethodVisitor.visitParameter(String, int).- 覆盖:
visitParameter在类中Printer
-
visitAnnotationDefault
从类复制的说明:PrinterMethod default annotation. SeeMethodVisitor.visitAnnotationDefault().- 指定者:
visitAnnotationDefault在类中Printer
-
visitMethodAnnotation
从类复制的说明:PrinterMethod annotation. SeeMethodVisitor.visitAnnotation(java.lang.String, boolean).- 指定者:
visitMethodAnnotation在类中Printer
-
visitMethodTypeAnnotation
public ASMifier visitMethodTypeAnnotation(int typeRef, TypePath typePath, String desc, boolean visible) 从类复制的说明:PrinterMethod type annotation. SeeMethodVisitor.visitTypeAnnotation(int, org.beetl.ow2.asm.TypePath, java.lang.String, boolean).- 覆盖:
visitMethodTypeAnnotation在类中Printer
-
visitParameterAnnotation
从类复制的说明:PrinterMethod parameter annotation. SeeMethodVisitor.visitParameterAnnotation(int, java.lang.String, boolean).- 指定者:
visitParameterAnnotation在类中Printer
-
visitMethodAttribute
从类复制的说明:PrinterMethod attribute. SeeMethodVisitor.visitAttribute(org.beetl.ow2.asm.Attribute).- 指定者:
visitMethodAttribute在类中Printer
-
visitCode
public void visitCode()从类复制的说明:PrinterMethod start. SeeMethodVisitor.visitCode(). -
visitFrame
从类复制的说明:PrinterMethod stack frame. SeeMethodVisitor.visitFrame(int, int, java.lang.Object[], int, java.lang.Object[]).- 指定者:
visitFrame在类中Printer
-
visitInsn
public void visitInsn(int opcode) 从类复制的说明:PrinterMethod instruction. SeeMethodVisitor.visitInsn(int). -
visitIntInsn
public void visitIntInsn(int opcode, int operand) 从类复制的说明:PrinterMethod instruction. SeeMethodVisitor.visitIntInsn(int, int).- 指定者:
visitIntInsn在类中Printer
-
visitVarInsn
public void visitVarInsn(int opcode, int var) 从类复制的说明:PrinterMethod instruction. SeeMethodVisitor.visitVarInsn(int, int).- 指定者:
visitVarInsn在类中Printer
-
visitTypeInsn
从类复制的说明:PrinterMethod instruction. SeeMethodVisitor.visitTypeInsn(int, java.lang.String).- 指定者:
visitTypeInsn在类中Printer
-
visitFieldInsn
从类复制的说明:PrinterMethod instruction. SeeMethodVisitor.visitFieldInsn(int, java.lang.String, java.lang.String, java.lang.String).- 指定者:
visitFieldInsn在类中Printer
-
visitMethodInsn
已过时。从类复制的说明:PrinterMethod instruction. SeeMethodVisitor.visitMethodInsn(int, java.lang.String, java.lang.String, java.lang.String).- 覆盖:
visitMethodInsn在类中Printer
-
visitMethodInsn
从类复制的说明:PrinterMethod instruction. SeeMethodVisitor.visitMethodInsn(int, java.lang.String, java.lang.String, java.lang.String).- 覆盖:
visitMethodInsn在类中Printer
-
visitInvokeDynamicInsn
从类复制的说明:PrinterMethod instruction. SeeMethodVisitor.visitInvokeDynamicInsn(java.lang.String, java.lang.String, org.beetl.ow2.asm.Handle, java.lang.Object...).- 指定者:
visitInvokeDynamicInsn在类中Printer
-
visitJumpInsn
从类复制的说明:PrinterMethod instruction. SeeMethodVisitor.visitJumpInsn(int, org.beetl.ow2.asm.Label).- 指定者:
visitJumpInsn在类中Printer
-
visitLabel
从类复制的说明:PrinterMethod label. SeeMethodVisitor.visitLabel(org.beetl.ow2.asm.Label).- 指定者:
visitLabel在类中Printer
-
visitLdcInsn
从类复制的说明:PrinterMethod instruction. SeeMethodVisitor.visitLdcInsn(java.lang.Object).- 指定者:
visitLdcInsn在类中Printer
-
visitIincInsn
public void visitIincInsn(int var, int increment) 从类复制的说明:PrinterMethod instruction. SeeMethodVisitor.visitIincInsn(int, int).- 指定者:
visitIincInsn在类中Printer
-
visitTableSwitchInsn
从类复制的说明:PrinterMethod instruction. SeeMethodVisitor.visitTableSwitchInsn(int, int, org.beetl.ow2.asm.Label, org.beetl.ow2.asm.Label...).- 指定者:
visitTableSwitchInsn在类中Printer
-
visitLookupSwitchInsn
从类复制的说明:PrinterMethod instruction. SeeMethodVisitor.visitLookupSwitchInsn(org.beetl.ow2.asm.Label, int[], org.beetl.ow2.asm.Label[]).- 指定者:
visitLookupSwitchInsn在类中Printer
-
visitMultiANewArrayInsn
从类复制的说明:PrinterMethod instruction. SeeMethodVisitor.visitMultiANewArrayInsn(java.lang.String, int).- 指定者:
visitMultiANewArrayInsn在类中Printer
-
visitInsnAnnotation
从类复制的说明:PrinterInstruction type annotation. SeeMethodVisitor.visitInsnAnnotation(int, org.beetl.ow2.asm.TypePath, java.lang.String, boolean).- 覆盖:
visitInsnAnnotation在类中Printer
-
visitTryCatchBlock
从类复制的说明:PrinterMethod exception handler. SeeMethodVisitor.visitTryCatchBlock(org.beetl.ow2.asm.Label, org.beetl.ow2.asm.Label, org.beetl.ow2.asm.Label, java.lang.String).- 指定者:
visitTryCatchBlock在类中Printer
-
visitTryCatchAnnotation
public ASMifier visitTryCatchAnnotation(int typeRef, TypePath typePath, String desc, boolean visible) 从类复制的说明:PrinterTry catch block type annotation. SeeMethodVisitor.visitTryCatchAnnotation(int, org.beetl.ow2.asm.TypePath, java.lang.String, boolean).- 覆盖:
visitTryCatchAnnotation在类中Printer
-
visitLocalVariable
public void visitLocalVariable(String name, String desc, String signature, Label start, Label end, int index) 从类复制的说明:PrinterMethod debug info. SeeMethodVisitor.visitLocalVariable(java.lang.String, java.lang.String, java.lang.String, org.beetl.ow2.asm.Label, org.beetl.ow2.asm.Label, int).- 指定者:
visitLocalVariable在类中Printer
-
visitLocalVariableAnnotation
public Printer visitLocalVariableAnnotation(int typeRef, TypePath typePath, Label[] start, Label[] end, int[] index, String desc, boolean visible) 从类复制的说明:PrinterLocal variable type annotation. SeeMethodVisitor.visitTryCatchAnnotation(int, org.beetl.ow2.asm.TypePath, java.lang.String, boolean).- 覆盖:
visitLocalVariableAnnotation在类中Printer
-
visitLineNumber
从类复制的说明:PrinterMethod debug info. SeeMethodVisitor.visitLineNumber(int, org.beetl.ow2.asm.Label).- 指定者:
visitLineNumber在类中Printer
-
visitMaxs
public void visitMaxs(int maxStack, int maxLocals) 从类复制的说明:PrinterMethod max stack and max locals. SeeMethodVisitor.visitMaxs(int, int). -
visitMethodEnd
public void visitMethodEnd()从类复制的说明:PrinterMethod end. SeeMethodVisitor.visitEnd().- 指定者:
visitMethodEnd在类中Printer
-
visitAnnotation
-
visitTypeAnnotation
-
visitTypeAnnotation
-
visitAttribute
-
createASMifier
-
appendConstant
Appends a string representation of the given constant to the given buffer. -
declareLabel
Appends a declaration of the given label tobuf. This declaration is of the form "Label lXXX = new Label();". Does nothing if the given label has already been declared.- 参数:
l- a label.
-
appendLabel
Appends the className of the given label tobuf. The given label must already have a className. One way to ensure this is to always calldeclaredbefore calling this method.- 参数:
l- a label.
-