java.lang.Object
com.techtrader.modules.tools.bytecode.visitor.BCVisitor
com.techtrader.modules.tools.bytecode.visitor.PrettyPrintVisitor
- All Implemented Interfaces:
- com.techtrader.modules.tools.bytecode.Constants
- public class PrettyPrintVisitor
- extends BCVisitor
- implements com.techtrader.modules.tools.bytecode.Constants
Visitor type that outputs a detailed, formatted document of the
visited entity; similar to the javap -c command but more detailed.
| Fields inherited from interface com.techtrader.modules.tools.bytecode.Constants |
AALOAD, AASTORE, ACCESS_ABSTRACT, ACCESS_FINAL, ACCESS_INTERFACE, ACCESS_NATIVE, ACCESS_PRIVATE, ACCESS_PROTECTED, ACCESS_PUBLIC, ACCESS_STATIC, ACCESS_STRICT, ACCESS_SUPER, ACCESS_SYNCHRONIZED, ACCESS_TRANSIENT, ACCESS_VOLATILE, ACONST_NULL, ALOAD, ALOAD_0, ALOAD_1, ALOAD_2, ALOAD_3, ANEWARRAY, ARETURN, ARRAY_BOOLEAN, ARRAY_BYTE, ARRAY_CHAR, ARRAY_DOUBLE, ARRAY_FLOAT, ARRAY_INT, ARRAY_LONG, ARRAY_SHORT, ARRAYLENGTH, ASTORE, ASTORE_0, ASTORE_1, ASTORE_2, ASTORE_3, ATHROW, ATTR_CODE, ATTR_CONST, ATTR_DEPRECATED, ATTR_EXCEPTIONS, ATTR_INNERCLASS, ATTR_LINENUMBERS, ATTR_LOCALS, ATTR_SOURCE, ATTR_SYNTHETIC, ATTR_UNKNOWN, BALOAD, BASTORE, BIPUSH, CALOAD, CASTORE, CHECKCAST, D2F, D2I, D2L, DADD, DALOAD, DASTORE, DCMPG, DCMPL, DCONST_0, DCONST_1, DDIV, DLOAD, DLOAD_0, DLOAD_1, DLOAD_2, DLOAD_3, DMUL, DNEG, DREM, DRETURN, DSTORE, DSTORE_0, DSTORE_1, DSTORE_2, DSTORE_3, DSUB, DUP, DUP_X1, DUP_X2, DUP2, DUP2_X1, DUP2_X2, F2D, F2I, F2L, FADD, FALOAD, FASTORE, FCMPG, FCMPL, FCONST_0, FCONST_1, FCONST_2, FDIV, FLOAD, FLOAD_0, FLOAD_1, FLOAD_2, FLOAD_3, FMUL, FNEG, FREM, FRETURN, FSTORE, FSTORE_0, FSTORE_1, FSTORE_2, FSTORE_3, FSUB, GETFIELD, GETSTATIC, GOTO, GOTO_W, I2B, I2C, I2D, I2F, I2L, I2S, IADD, IALOAD, IAND, IASTORE, ICONST_0, ICONST_1, ICONST_2, ICONST_3, ICONST_4, ICONST_5, ICONST_M1, IDIV, IF_ACMPEQ, IF_ACMPNE, IF_EQ, IF_GE, IF_GT, IF_ICMPEQ, IF_ICMPGE, IF_ICMPGT, IF_ICMPLE, IF_ICMPLT, IF_ICMPNE, IF_LE, IF_LT, IF_NE, IF_NONNULL, IF_NULL, IINC, ILOAD, ILOAD_0, ILOAD_1, ILOAD_2, ILOAD_3, IMUL, INEG, INSTANCEOF, INVOKEINTERFACE, INVOKESPECIAL, INVOKESTATIC, INVOKEVIRTUAL, IOR, IREM, IRETURN, ISHL, ISHR, ISTORE, ISTORE_0, ISTORE_1, ISTORE_2, ISTORE_3, ISUB, IUSHR, IXOR, JSR, JSR_W, L2D, L2F, L2I, LADD, LALOAD, LAND, LASTORE, LCMP, LCONST_0, LCONST_1, LDC, LDC_W, LDC2_W, LDIV, LLOAD, LLOAD_0, LLOAD_1, LLOAD_2, LLOAD_3, LMUL, LNEG, LOOKUPSWITCH, LOR, LREM, LRETURN, LSHL, LSHR, LSTORE, LSTORE_0, LSTORE_1, LSTORE_2, LSTORE_3, LSUB, LUSHR, LXOR, MATH_ADD, MATH_AND, MATH_DIV, MATH_MUL, MATH_NEG, MATH_OR, MATH_REM, MATH_SHL, MATH_SHR, MATH_SUB, MATH_USHR, MATH_XOR, MONITORENTER, MONITOREXIT, MULTIANEWARRAY, NEW, NEWARRAY, NOP, OPCODE_NAMES, POP, POP2, PUTFIELD, PUTSTATIC, RET, RETURN, SALOAD, SASTORE, SIPUSH, SWAP, TABLESWITCH, VALID_MAGIC, WIDE |
| Methods inherited from class com.techtrader.modules.tools.bytecode.visitor.BCVisitor |
enterArrayLoadInstruction, enterArrayStoreInstruction, enterCmpInstruction, enterConvertInstruction, enterDeprecatedAttribute, enterInnerClassesAttribute, enterLineNumberTableAttribute, enterLocalVariableTableAttribute, enterMathInstruction, enterMonitorEnterInstruction, enterMonitorExitInstruction, enterPlaceHolderEntry, enterReturnInstruction, enterStackInstruction, enterSyntheticAttribute, exitArrayLoadInstruction, exitArrayStoreInstruction, exitClassEntry, exitClassInstruction, exitCmpInstruction, exitCode, exitConstantInstruction, exitConstantValueAttribute, exitConvertInstruction, exitDeprecatedAttribute, exitDoubleEntry, exitExceptionsAttribute, exitFieldEntry, exitFloatEntry, exitGetFieldInstruction, exitIIncInstruction, exitInnerClassesAttribute, exitIntEntry, exitInterfaceMethodEntry, exitJumpInstruction, exitLineNumberTableAttribute, exitLoadInstruction, exitLocalVariableTableAttribute, exitLongEntry, exitLookupSwitchInstruction, exitMathInstruction, exitMethodEntry, exitMethodInstruction, exitMonitorEnterInstruction, exitMonitorExitInstruction, exitMultiANewArrayInstruction, exitNameAndTypeEntry, exitNewArrayInstruction, exitPlaceHolderEntry, exitPutFieldInstruction, exitRetInstruction, exitReturnInstruction, exitSourceFileAttribute, exitStackInstruction, exitStoreInstruction, exitStringEntry, exitSyntheticAttribute, exitTableSwitchInstruction, exitUnknownAttribute, exitUTF8Entry, exitWideInstruction |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
_out
private java.io.PrintWriter _out
_prefix
private java.lang.String _prefix
_entryCount
private int _entryCount
PrettyPrintVisitor
public PrettyPrintVisitor()
- Constructor; all pritning will go to stdout.
PrettyPrintVisitor
public PrettyPrintVisitor(java.io.PrintWriter out)
- Constructor.
main
public static void main(java.lang.String[] args)
throws java.lang.ClassNotFoundException,
java.io.IOException
- Invoke with the class or file names to pretty print; the
functionality is similar to the javap -c command, but more
detailed.
visit
public void visit(VisitAcceptor entity)
- Description copied from class:
BCVisitor
- Visit the given entity.
- Overrides:
visit in class BCVisitor
enterBCClass
public void enterBCClass(com.techtrader.modules.tools.bytecode.BCClass obj)
- Overrides:
enterBCClass in class BCVisitor
exitBCClass
public void exitBCClass(com.techtrader.modules.tools.bytecode.BCClass obj)
- Overrides:
exitBCClass in class BCVisitor
enterBCField
public void enterBCField(com.techtrader.modules.tools.bytecode.BCField obj)
- Overrides:
enterBCField in class BCVisitor
exitBCField
public void exitBCField(com.techtrader.modules.tools.bytecode.BCField obj)
- Overrides:
exitBCField in class BCVisitor
enterBCMethod
public void enterBCMethod(com.techtrader.modules.tools.bytecode.BCMethod obj)
- Overrides:
enterBCMethod in class BCVisitor
exitBCMethod
public void exitBCMethod(com.techtrader.modules.tools.bytecode.BCMethod obj)
- Overrides:
exitBCMethod in class BCVisitor
enterAttribute
public void enterAttribute(com.techtrader.modules.tools.bytecode.Attribute obj)
- Overrides:
enterAttribute in class BCVisitor
exitAttribute
public void exitAttribute(com.techtrader.modules.tools.bytecode.Attribute obj)
- Overrides:
exitAttribute in class BCVisitor
enterConstantValueAttribute
public void enterConstantValueAttribute(com.techtrader.modules.tools.bytecode.ConstantValueAttribute obj)
- Overrides:
enterConstantValueAttribute in class BCVisitor
enterExceptionsAttribute
public void enterExceptionsAttribute(com.techtrader.modules.tools.bytecode.ExceptionsAttribute obj)
- Overrides:
enterExceptionsAttribute in class BCVisitor
enterSourceFileAttribute
public void enterSourceFileAttribute(com.techtrader.modules.tools.bytecode.SourceFileAttribute obj)
- Overrides:
enterSourceFileAttribute in class BCVisitor
enterUnknownAttribute
public void enterUnknownAttribute(com.techtrader.modules.tools.bytecode.UnknownAttribute obj)
- Overrides:
enterUnknownAttribute in class BCVisitor
enterCode
public void enterCode(com.techtrader.modules.tools.bytecode.Code obj)
- Overrides:
enterCode in class BCVisitor
enterExceptionHandler
public void enterExceptionHandler(com.techtrader.modules.tools.bytecode.ExceptionHandler obj)
- Overrides:
enterExceptionHandler in class BCVisitor
exitExceptionHandler
public void exitExceptionHandler(com.techtrader.modules.tools.bytecode.ExceptionHandler obj)
- Overrides:
exitExceptionHandler in class BCVisitor
enterInnerClass
public void enterInnerClass(com.techtrader.modules.tools.bytecode.InnerClass obj)
- Overrides:
enterInnerClass in class BCVisitor
exitInnerClass
public void exitInnerClass(com.techtrader.modules.tools.bytecode.InnerClass obj)
- Overrides:
exitInnerClass in class BCVisitor
enterLineNumber
public void enterLineNumber(com.techtrader.modules.tools.bytecode.LineNumber obj)
- Overrides:
enterLineNumber in class BCVisitor
exitLineNumber
public void exitLineNumber(com.techtrader.modules.tools.bytecode.LineNumber obj)
- Overrides:
exitLineNumber in class BCVisitor
enterLocalVariable
public void enterLocalVariable(com.techtrader.modules.tools.bytecode.LocalVariable obj)
- Overrides:
enterLocalVariable in class BCVisitor
exitLocalVariable
public void exitLocalVariable(com.techtrader.modules.tools.bytecode.LocalVariable obj)
- Overrides:
exitLocalVariable in class BCVisitor
enterInstruction
public void enterInstruction(com.techtrader.modules.tools.bytecode.Instruction obj)
- Overrides:
enterInstruction in class BCVisitor
exitInstruction
public void exitInstruction(com.techtrader.modules.tools.bytecode.Instruction obj)
- Overrides:
exitInstruction in class BCVisitor
enterClassInstruction
public void enterClassInstruction(com.techtrader.modules.tools.bytecode.ClassInstruction obj)
- Overrides:
enterClassInstruction in class BCVisitor
enterConstantInstruction
public void enterConstantInstruction(com.techtrader.modules.tools.bytecode.ConstantInstruction obj)
- Overrides:
enterConstantInstruction in class BCVisitor
enterGetFieldInstruction
public void enterGetFieldInstruction(com.techtrader.modules.tools.bytecode.GetFieldInstruction obj)
- Overrides:
enterGetFieldInstruction in class BCVisitor
enterIIncInstruction
public void enterIIncInstruction(com.techtrader.modules.tools.bytecode.IIncInstruction obj)
- Overrides:
enterIIncInstruction in class BCVisitor
enterJumpInstruction
public void enterJumpInstruction(com.techtrader.modules.tools.bytecode.JumpInstruction obj)
- Overrides:
enterJumpInstruction in class BCVisitor
enterLoadInstruction
public void enterLoadInstruction(com.techtrader.modules.tools.bytecode.LoadInstruction obj)
- Overrides:
enterLoadInstruction in class BCVisitor
enterLookupSwitchInstruction
public void enterLookupSwitchInstruction(com.techtrader.modules.tools.bytecode.LookupSwitchInstruction obj)
- Overrides:
enterLookupSwitchInstruction in class BCVisitor
enterMethodInstruction
public void enterMethodInstruction(com.techtrader.modules.tools.bytecode.MethodInstruction obj)
- Overrides:
enterMethodInstruction in class BCVisitor
enterMultiANewArrayInstruction
public void enterMultiANewArrayInstruction(com.techtrader.modules.tools.bytecode.MultiANewArrayInstruction obj)
- Overrides:
enterMultiANewArrayInstruction in class BCVisitor
enterNewArrayInstruction
public void enterNewArrayInstruction(com.techtrader.modules.tools.bytecode.NewArrayInstruction obj)
- Overrides:
enterNewArrayInstruction in class BCVisitor
enterPutFieldInstruction
public void enterPutFieldInstruction(com.techtrader.modules.tools.bytecode.PutFieldInstruction obj)
- Overrides:
enterPutFieldInstruction in class BCVisitor
enterRetInstruction
public void enterRetInstruction(com.techtrader.modules.tools.bytecode.RetInstruction obj)
- Overrides:
enterRetInstruction in class BCVisitor
enterStoreInstruction
public void enterStoreInstruction(com.techtrader.modules.tools.bytecode.StoreInstruction obj)
- Overrides:
enterStoreInstruction in class BCVisitor
enterTableSwitchInstruction
public void enterTableSwitchInstruction(com.techtrader.modules.tools.bytecode.TableSwitchInstruction obj)
- Overrides:
enterTableSwitchInstruction in class BCVisitor
enterWideInstruction
public void enterWideInstruction(com.techtrader.modules.tools.bytecode.WideInstruction obj)
- Overrides:
enterWideInstruction in class BCVisitor
enterConstantPool
public void enterConstantPool(com.techtrader.modules.tools.bytecode.lowlevel.ConstantPool obj)
- Overrides:
enterConstantPool in class BCVisitor
exitConstantPool
public void exitConstantPool(com.techtrader.modules.tools.bytecode.lowlevel.ConstantPool obj)
- Overrides:
exitConstantPool in class BCVisitor
enterEntry
public void enterEntry(com.techtrader.modules.tools.bytecode.lowlevel.Entry obj)
- Overrides:
enterEntry in class BCVisitor
exitEntry
public void exitEntry(com.techtrader.modules.tools.bytecode.lowlevel.Entry obj)
- Overrides:
exitEntry in class BCVisitor
enterClassEntry
public void enterClassEntry(com.techtrader.modules.tools.bytecode.lowlevel.ClassEntry obj)
- Overrides:
enterClassEntry in class BCVisitor
enterDoubleEntry
public void enterDoubleEntry(com.techtrader.modules.tools.bytecode.lowlevel.DoubleEntry obj)
- Overrides:
enterDoubleEntry in class BCVisitor
enterFieldEntry
public void enterFieldEntry(com.techtrader.modules.tools.bytecode.lowlevel.FieldEntry obj)
- Overrides:
enterFieldEntry in class BCVisitor
enterFloatEntry
public void enterFloatEntry(com.techtrader.modules.tools.bytecode.lowlevel.FloatEntry obj)
- Overrides:
enterFloatEntry in class BCVisitor
enterIntEntry
public void enterIntEntry(com.techtrader.modules.tools.bytecode.lowlevel.IntEntry obj)
- Overrides:
enterIntEntry in class BCVisitor
enterInterfaceMethodEntry
public void enterInterfaceMethodEntry(com.techtrader.modules.tools.bytecode.lowlevel.InterfaceMethodEntry obj)
- Overrides:
enterInterfaceMethodEntry in class BCVisitor
enterLongEntry
public void enterLongEntry(com.techtrader.modules.tools.bytecode.lowlevel.LongEntry obj)
- Overrides:
enterLongEntry in class BCVisitor
enterMethodEntry
public void enterMethodEntry(com.techtrader.modules.tools.bytecode.lowlevel.MethodEntry obj)
- Overrides:
enterMethodEntry in class BCVisitor
enterNameAndTypeEntry
public void enterNameAndTypeEntry(com.techtrader.modules.tools.bytecode.lowlevel.NameAndTypeEntry obj)
- Overrides:
enterNameAndTypeEntry in class BCVisitor
enterStringEntry
public void enterStringEntry(com.techtrader.modules.tools.bytecode.lowlevel.StringEntry obj)
- Overrides:
enterStringEntry in class BCVisitor
enterUTF8Entry
public void enterUTF8Entry(com.techtrader.modules.tools.bytecode.lowlevel.UTF8Entry obj)
- Overrides:
enterUTF8Entry in class BCVisitor
println
private void println(java.lang.String ln)
openBlock
private void openBlock(java.lang.String name)
closeBlock
private void closeBlock()