org.objectweb.asm.util
类 AbstractVisitor

java.lang.Object
  继承者 org.objectweb.asm.util.AbstractVisitor
直接已知子类:
ASMifierAbstractVisitor, ASMifierAnnotationVisitor, TraceAbstractVisitor

public abstract class AbstractVisitor
extends Object

An abstract visitor.

作者:
Eric Bruneton

字段摘要
protected  StringBuffer buf
          A buffer that can be used to create strings.
static String[] OPCODES
          The names of the Java Virtual Machine opcodes.
 List text
          The text to be printed.
static String[] TYPES
          Types for operand parameter of the MethodVisitor.visitIntInsn(int, int) method when opcode is NEWARRAY.
 
构造方法摘要
protected AbstractVisitor()
          Constructs a new AbstractVisitor.
 
方法摘要
static void appendString(StringBuffer buf, String s)
          Appends a quoted string to a given buffer.
static Attribute[] getDefaultAttributes()
          Returns the default ASMifiable prototypes.
 List getText()
          Returns the text constructed by this visitor.
 void print(PrintWriter pw)
          Prints the text constructed by this visitor.
 
从类 java.lang.Object 继承的方法
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

字段详细信息

OPCODES

public static final String[] OPCODES
The names of the Java Virtual Machine opcodes.


TYPES

public static final String[] TYPES
Types for operand parameter of the MethodVisitor.visitIntInsn(int, int) method when opcode is NEWARRAY.


text

public final List text
The text to be printed. Since the code of methods is not necessarily visited in sequential order, one method after the other, but can be interlaced (some instructions from method one, then some instructions from method two, then some instructions from method one again...), it is not possible to print the visited instructions directly to a sequential stream. A class is therefore printed in a two steps process: a string tree is constructed during the visit, and printed to a sequential stream at the end of the visit. This string tree is stored in this field, as a string list that can contain other string lists, which can themselves contain other string lists, and so on.


buf

protected final StringBuffer buf
A buffer that can be used to create strings.

构造方法详细信息

AbstractVisitor

protected AbstractVisitor()
Constructs a new AbstractVisitor.

方法详细信息

getText

public List getText()
Returns the text constructed by this visitor.

返回:
the text constructed by this visitor.

print

public void print(PrintWriter pw)
Prints the text constructed by this visitor.

参数:
pw - the print writer to be used.

appendString

public static void appendString(StringBuffer buf,
                                String s)
Appends a quoted string to a given buffer.

参数:
buf - the buffer where the string must be added.
s - the string to be added.

getDefaultAttributes

public static Attribute[] getDefaultAttributes()
Returns the default ASMifiable prototypes.

返回:
the default ASMifiable prototypes.


Copyright © 2013. All Rights Reserved.