Class AbstractVisitor
java.lang.Object
org.objectweb.asm.util.AbstractVisitor
- Direct Known Subclasses:
ASMifierAbstractVisitor, ASMifierAnnotationVisitor, TraceAbstractVisitor
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected final StringBufferA buffer that can be used to create strings.static final String[]The names of the Java Virtual Machine opcodes.final ListThe text to be printed.static final String[]Types foroperandparameter of theMethodVisitor.visitIntInsn(int, int)method whenopcodeisNEWARRAY. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic voidappendString(StringBuffer buf, String s) Appends a quoted string to a given buffer.static Attribute[]Returns the defaultASMifiableprototypes.getText()Returns the text constructed by this visitor.voidprint(PrintWriter pw) Prints the text constructed by this visitor.
-
Field Details
-
OPCODES
The names of the Java Virtual Machine opcodes. -
TYPES
Types foroperandparameter of theMethodVisitor.visitIntInsn(int, int)method whenopcodeisNEWARRAY. -
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
A buffer that can be used to create strings.
-
-
Constructor Details
-
AbstractVisitor
protected AbstractVisitor()Constructs a newAbstractVisitor.
-
-
Method Details
-
getText
Returns the text constructed by this visitor.- Returns:
- the text constructed by this visitor.
-
print
Prints the text constructed by this visitor.- Parameters:
pw- the print writer to be used.
-
appendString
Appends a quoted string to a given buffer.- Parameters:
buf- the buffer where the string must be added.s- the string to be added.
-
getDefaultAttributes
Returns the defaultASMifiableprototypes.- Returns:
- the default
ASMifiableprototypes.
-