Modifier and Type | Field and Description |
---|---|
static int |
CLASS_DECLARATION
Constant used in
appendDescriptor for class
signatures, formatted in default Java notation (non-bytecode) |
static int |
CLASS_SIGNATURE
Constant used in
appendDescriptor for class
signatures, formatted in bytecode notation |
static int |
FIELD_DESCRIPTOR
Constant used in
appendDescriptor for field
descriptors, formatted in bytecode notation |
static int |
FIELD_SIGNATURE
Constant used in
appendDescriptor for field
signatures, formatted in bytecode notation |
static int |
HANDLE_DESCRIPTOR
Constant used in
appendDescriptor for handle
descriptors, formatted in bytecode notation |
static int |
INTERNAL_NAME
Constant used in
appendDescriptor for internal
type names in bytecode notation. |
protected Map<Label,String> |
labelNames
The label names.
|
protected String |
ltab
Tab for labels.
|
static int |
METHOD_DESCRIPTOR
Constant used in
appendDescriptor for method
descriptors, formatted in bytecode notation |
static int |
METHOD_SIGNATURE
Constant used in
appendDescriptor for method
signatures, formatted in bytecode notation |
static int |
PARAMETERS_DECLARATION
Constant used in
appendDescriptor for method
parameter signatures, formatted in default Java notation (non-bytecode) |
protected String |
tab
Tab for class members.
|
protected String |
tab2
Tab for bytecode instructions.
|
protected String |
tab3
Tab for table and lookup switch instructions.
|
static int |
TYPE_DECLARATION
Constant used in
appendDescriptor for field or
method return value signatures, formatted in default Java notation
(non-bytecode) |
Modifier | Constructor and Description |
---|---|
|
Textifier()
Constructs a new
Textifier . |
protected |
Textifier(int api)
Constructs a new
Textifier . |
Modifier and Type | Method and Description |
---|---|
protected void |
appendDescriptor(int type,
String desc)
Appends an internal name, a type descriptor or a type signature to
buf . |
protected void |
appendHandle(Handle h)
Appends the information about the given handle to
buf . |
protected void |
appendLabel(Label l)
Appends the name of the given label to
buf . |
protected Textifier |
createTextifier()
Creates a new TraceVisitor instance.
|
static void |
main(String[] args)
Prints a disassembled view of 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.
|
Textifier |
visitAnnotation(String desc,
boolean visible)
Prints a disassembled view of the given annotation.
|
Textifier |
visitAnnotation(String name,
String desc)
Nested annotation value.
|
Textifier |
visitAnnotationDefault()
Method default annotation.
|
void |
visitAnnotationEnd()
Annotation end.
|
Textifier |
visitArray(String name)
Annotation array value.
|
void |
visitAttribute(Attribute attr)
Prints a disassembled view of the given attribute.
|
Textifier |
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.
|
Textifier |
visitField(int access,
String name,
String desc,
String signature,
Object value)
Class field.
|
Textifier |
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.
|
Textifier |
visitMethod(int access,
String name,
String desc,
String signature,
String[] exceptions)
Class method.
|
Textifier |
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.
|
Textifier |
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
public static final int INTERNAL_NAME
appendDescriptor
for internal
type names in bytecode notation.public static final int FIELD_DESCRIPTOR
appendDescriptor
for field
descriptors, formatted in bytecode notationpublic static final int FIELD_SIGNATURE
appendDescriptor
for field
signatures, formatted in bytecode notationpublic static final int METHOD_DESCRIPTOR
appendDescriptor
for method
descriptors, formatted in bytecode notationpublic static final int METHOD_SIGNATURE
appendDescriptor
for method
signatures, formatted in bytecode notationpublic static final int CLASS_SIGNATURE
appendDescriptor
for class
signatures, formatted in bytecode notationpublic static final int TYPE_DECLARATION
appendDescriptor
for field or
method return value signatures, formatted in default Java notation
(non-bytecode)public static final int CLASS_DECLARATION
appendDescriptor
for class
signatures, formatted in default Java notation (non-bytecode)public static final int PARAMETERS_DECLARATION
appendDescriptor
for method
parameter signatures, formatted in default Java notation (non-bytecode)public static final int HANDLE_DESCRIPTOR
appendDescriptor
for handle
descriptors, formatted in bytecode notationprotected String tab
protected String tab2
protected String tab3
protected String ltab
public Textifier()
Textifier
. Subclasses must not use this
constructor. Instead, they must use the Textifier(int)
version.protected Textifier(int api)
Textifier
.api
- the ASM API version implemented by this visitor. Must be one
of Opcodes.ASM4
.public static void main(String[] args) throws Exception
Usage: Textifier [-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 Textifier 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 Textifier 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 Textifier 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 Textifier visitAnnotation(String name, String desc)
Printer
AnnotationVisitor.visitAnnotation(java.lang.String, java.lang.String)
.visitAnnotation
in class Printer
public Textifier visitArray(String name)
Printer
AnnotationVisitor.visitArray(java.lang.String)
.visitArray
in class Printer
public void visitAnnotationEnd()
Printer
AnnotationVisitor.visitEnd()
.visitAnnotationEnd
in class Printer
public Textifier 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 Textifier visitAnnotationDefault()
Printer
MethodVisitor.visitAnnotationDefault()
.visitAnnotationDefault
in class Printer
public Textifier visitMethodAnnotation(String desc, boolean visible)
Printer
MethodVisitor.visitAnnotation(java.lang.String, boolean)
.visitMethodAnnotation
in class Printer
public Textifier 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 Textifier visitAnnotation(String desc, boolean visible)
desc
- the class descriptor of the annotation class.visible
- true if the annotation is visible at runtime.public void visitAttribute(Attribute attr)
attr
- an attribute.protected Textifier createTextifier()
protected void appendDescriptor(int type, String desc)
buf
.type
- indicates if desc is an internal name, a field descriptor, a
method descriptor, a class signature, ...desc
- an internal name, type descriptor, or type signature. May be
null.protected void appendLabel(Label l)
buf
. Creates a new
label name if the given label does not yet have one.l
- a label.Copyright © 2018. All rights reserved.