Package serp.bytecode.visitor

# Class PrettyPrintVisitor

java.lang.Object
serp.bytecode.visitor.BCVisitor
serp.bytecode.visitor.PrettyPrintVisitor

public class PrettyPrintVisitor extends BCVisitor
Visitor type that outputs a detailed, formatted document of the visited entity; similar to the javap -c command but more detailed.

Author:
  Abe White

## Constructor Summary

Constructors
Constructor
Description
`PrettyPrintVisitor()`
Constructor; all pritning will go to stdout.
`PrettyPrintVisitor(PrintWriter out)`
Constructor.

## Method Summary

Modifier and Type
Method
Description
`void`
`enterAnnotation(Annotation obj)`
`void`
`enterAnnotationProperty(Annotation.Property obj)`
`void`
`enterAttribute(Attribute obj)`
`void`
`enterBCClass(BCClass obj)`
`void`
`enterBCField(BCField obj)`
`void`
`enterBCMethod(BCMethod obj)`
`void`
`enterClassEntry(ClassEntry obj)`
`void`
`enterClassInstruction(ClassInstruction obj)`
`void`
`enterCode(Code obj)`
`void`
`enterConstantInstruction(ConstantInstruction obj)`
`void`
`enterConstantPool(ConstantPool obj)`
`void`
`enterConstantValue(ConstantValue obj)`
`void`
`enterDoubleEntry(DoubleEntry obj)`
`void`
`enterEntry(Entry obj)`
`void`
`enterExceptionHandler(ExceptionHandler obj)`
`void`
`enterExceptions(Exceptions obj)`
`void`
`enterFieldEntry(FieldEntry obj)`
`void`
`enterFloatEntry(FloatEntry obj)`
`void`
`enterGetFieldInstruction(GetFieldInstruction obj)`
`void`
`enterIfInstruction(IfInstruction obj)`
`void`
`enterIIncInstruction(IIncInstruction obj)`
`void`
`enterInnerClass(InnerClass obj)`
`void`
`enterInstruction(Instruction obj)`
`void`
`enterIntEntry(IntEntry obj)`
`void`
`enterInterfaceMethodEntry(InterfaceMethodEntry obj)`
`void`
`enterJumpInstruction(JumpInstruction obj)`
`void`
`enterLineNumber(LineNumber obj)`
`void`
`enterLoadInstruction(LoadInstruction obj)`
`void`
`enterLocalVariable(LocalVariable obj)`
`void`
`enterLocalVariableType(LocalVariableType obj)`
`void`
`enterLongEntry(LongEntry obj)`
`void`
`enterLookupSwitchInstruction(LookupSwitchInstruction obj)`
`void`
`enterMethodEntry(MethodEntry obj)`
`void`
`enterMethodInstruction(MethodInstruction obj)`
`void`
`enterMultiANewArrayInstruction(MultiANewArrayInstruction obj)`
`void`
`enterNameAndTypeEntry(NameAndTypeEntry obj)`
`void`
`enterNewArrayInstruction(NewArrayInstruction obj)`
`void`
`enterProject(Project obj)`
`void`
`enterPutFieldInstruction(PutFieldInstruction obj)`
`void`
`enterRetInstruction(RetInstruction obj)`
`void`
`enterSourceFile(SourceFile obj)`
`void`
`enterStoreInstruction(StoreInstruction obj)`
`void`
`enterStringEntry(StringEntry obj)`
`void`
`enterTableSwitchInstruction(TableSwitchInstruction obj)`
`void`
`enterUTF8Entry(UTF8Entry obj)`
`void`
`enterWideInstruction(WideInstruction obj)`
`void`
`exitAnnotation(Annotation obj)`
`void`
`exitAnnotationProperty(Annotation.Property obj)`
`void`
`exitAttribute(Attribute obj)`
`void`
`exitBCClass(BCClass obj)`
`void`
`exitBCField(BCField obj)`
`void`
`exitBCMethod(BCMethod obj)`
`void`
`exitConstantPool(ConstantPool obj)`
`void`
`exitEntry(Entry obj)`
`void`
`exitExceptionHandler(ExceptionHandler obj)`
`void`
`exitInnerClass(InnerClass obj)`
`void`
`exitInstruction(Instruction obj)`
`void`
`exitLineNumber(LineNumber obj)`
`void`
`exitLocalVariable(LocalVariable obj)`
`void`
`exitLocalVariableType(LocalVariableType obj)`
`void`
`exitProject(Project obj)`
`static void`
`main(String[] args)`
Invoke with the class or file names to pretty print; the functionality is similar to the javap -c command, but more detailed.
`void`
`visit(VisitAcceptor entity)`
Visit the given entity.

### Methods inherited from class serp.bytecode.visitor.BCVisitor

`enterAnnotations, enterArrayLoadInstruction, enterArrayStoreInstruction, enterBCMember, enterBootstrapMethod, enterCmpInstruction, enterConvertInstruction, enterDeprecated, enterInnerClasses, enterInvokeDynamicEntry, enterLineNumberTable, enterLocalVariableTable, enterLocalVariableTypeTable, enterMathInstruction, enterMethodHandleEntry, enterMethodTypeEntry, enterMonitorEnterInstruction, enterMonitorExitInstruction, enterReturnInstruction, enterStackInstruction, enterSynthetic, enterUnknownAttribute, exitAnnotations, exitArrayLoadInstruction, exitArrayStoreInstruction, exitBCMember, exitBootstrapMethod, exitClassEntry, exitClassInstruction, exitCmpInstruction, exitCode, exitConstantInstruction, exitConstantValue, exitConvertInstruction, exitDeprecated, exitDoubleEntry, exitExceptions, exitFieldEntry, exitFloatEntry, exitGetFieldInstruction, exitIfInstruction, exitIIncInstruction, exitInnerClasses, exitIntEntry, exitInterfaceMethodEntry, exitInvokeDynamicEntry, exitJumpInstruction, exitLineNumberTable, exitLoadInstruction, exitLocalVariableTable, exitLocalVariableTypeTable, exitLongEntry, exitLookupSwitchInstruction, exitMathInstruction, exitMethodEntry, exitMethodHandleEntry, exitMethodInstruction, exitMethodTypeEntry, exitMonitorEnterInstruction, exitMonitorExitInstruction, exitMultiANewArrayInstruction, exitNameAndTypeEntry, exitNewArrayInstruction, exitPutFieldInstruction, exitRetInstruction, exitReturnInstruction, exitSourceFile, exitStackInstruction, exitStoreInstruction, exitStringEntry, exitSynthetic, exitTableSwitchInstruction, exitUnknownAttribute, exitUTF8Entry, exitWideInstruction`

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

## Constructor Details

### PrettyPrintVisitor

public PrettyPrintVisitor()
Constructor; all pritning will go to stdout.

### PrettyPrintVisitor

public PrettyPrintVisitor(PrintWriter out)
Constructor.

Parameters:
  `out` - the stream to print to

## Method Details

### main

public static void main(String[] args) throws ClassNotFoundException, IOException
Invoke with the class or file names to pretty print; the functionality is similar to the javap -c command, but more detailed.

Throws:
  `ClassNotFoundException`
  `IOException`

### visit

public void visit(VisitAcceptor entity)
Description copied from class: `BCVisitor`
Visit the given entity.

Overrides:
  `visit` in class `BCVisitor`

### enterProject

public void enterProject(Project obj)

Overrides:
  `enterProject` in class `BCVisitor`

### exitProject

public void exitProject(Project obj)

Overrides:
  `exitProject` in class `BCVisitor`

### enterBCClass

public void enterBCClass(BCClass obj)

Overrides:
  `enterBCClass` in class `BCVisitor`

### exitBCClass

public void exitBCClass(BCClass obj)

Overrides:
  `exitBCClass` in class `BCVisitor`

### enterBCField

public void enterBCField(BCField obj)

Overrides:
  `enterBCField` in class `BCVisitor`

### exitBCField

public void exitBCField(BCField obj)

Overrides:
  `exitBCField` in class `BCVisitor`

### enterBCMethod

public void enterBCMethod(BCMethod obj)

Overrides:
  `enterBCMethod` in class `BCVisitor`

### exitBCMethod

public void exitBCMethod(BCMethod obj)

Overrides:
  `exitBCMethod` in class `BCVisitor`

### enterAttribute

public void enterAttribute(Attribute obj)

Overrides:
  `enterAttribute` in class `BCVisitor`

### exitAttribute

public void exitAttribute(Attribute obj)

Overrides:
  `exitAttribute` in class `BCVisitor`

### enterConstantValue

public void enterConstantValue(ConstantValue obj)

Overrides:
  `enterConstantValue` in class `BCVisitor`

### enterExceptions

public void enterExceptions(Exceptions obj)

Overrides:
  `enterExceptions` in class `BCVisitor`

### enterSourceFile

public void enterSourceFile(SourceFile obj)

Overrides:
  `enterSourceFile` in class `BCVisitor`

### enterCode

public void enterCode(Code obj)

Overrides:
  `enterCode` in class `BCVisitor`

### enterExceptionHandler

public void enterExceptionHandler(ExceptionHandler obj)

Overrides:
  `enterExceptionHandler` in class `BCVisitor`

### exitExceptionHandler

public void exitExceptionHandler(ExceptionHandler obj)

Overrides:
  `exitExceptionHandler` in class `BCVisitor`

### enterInnerClass

public void enterInnerClass(InnerClass obj)

Overrides:
  `enterInnerClass` in class `BCVisitor`

### exitInnerClass

public void exitInnerClass(InnerClass obj)

Overrides:
  `exitInnerClass` in class `BCVisitor`

### enterLineNumber

public void enterLineNumber(LineNumber obj)

Overrides:
  `enterLineNumber` in class `BCVisitor`

### exitLineNumber

public void exitLineNumber(LineNumber obj)

Overrides:
  `exitLineNumber` in class `BCVisitor`

### enterLocalVariable

public void enterLocalVariable(LocalVariable obj)

Overrides:
  `enterLocalVariable` in class `BCVisitor`

### exitLocalVariable

public void exitLocalVariable(LocalVariable obj)

Overrides:
  `exitLocalVariable` in class `BCVisitor`

### enterLocalVariableType

public void enterLocalVariableType(LocalVariableType obj)

Overrides:
  `enterLocalVariableType` in class `BCVisitor`

### exitLocalVariableType

public void exitLocalVariableType(LocalVariableType obj)

Overrides:
  `exitLocalVariableType` in class `BCVisitor`

### enterAnnotation

public void enterAnnotation(Annotation obj)

Overrides:
  `enterAnnotation` in class `BCVisitor`

### exitAnnotation

public void exitAnnotation(Annotation obj)

Overrides:
  `exitAnnotation` in class `BCVisitor`

### enterAnnotationProperty

public void enterAnnotationProperty(Annotation.Property obj)

Overrides:
  `enterAnnotationProperty` in class `BCVisitor`

### exitAnnotationProperty

public void exitAnnotationProperty(Annotation.Property obj)

Overrides:
  `exitAnnotationProperty` in class `BCVisitor`

### enterInstruction

public void enterInstruction(Instruction obj)

Overrides:
  `enterInstruction` in class `BCVisitor`

### exitInstruction

public void exitInstruction(Instruction obj)

Overrides:
  `exitInstruction` in class `BCVisitor`

### enterClassInstruction

public void enterClassInstruction(ClassInstruction obj)

Overrides:
  `enterClassInstruction` in class `BCVisitor`

### enterConstantInstruction

public void enterConstantInstruction(ConstantInstruction obj)

Overrides:
  `enterConstantInstruction` in class `BCVisitor`

### enterGetFieldInstruction

public void enterGetFieldInstruction(GetFieldInstruction obj)

Overrides:
  `enterGetFieldInstruction` in class `BCVisitor`

### enterIIncInstruction

public void enterIIncInstruction(IIncInstruction obj)

Overrides:
  `enterIIncInstruction` in class `BCVisitor`

### enterJumpInstruction

public void enterJumpInstruction(JumpInstruction obj)

Overrides:
  `enterJumpInstruction` in class `BCVisitor`

### enterIfInstruction

public void enterIfInstruction(IfInstruction obj)

Overrides:
  `enterIfInstruction` in class `BCVisitor`

### enterLoadInstruction

public void enterLoadInstruction(LoadInstruction obj)

Overrides:
  `enterLoadInstruction` in class `BCVisitor`

### enterLookupSwitchInstruction

public void enterLookupSwitchInstruction(LookupSwitchInstruction obj)

Overrides:
  `enterLookupSwitchInstruction` in class `BCVisitor`

### enterMethodInstruction

public void enterMethodInstruction(MethodInstruction obj)

Overrides:
  `enterMethodInstruction` in class `BCVisitor`

### enterMultiANewArrayInstruction

public void enterMultiANewArrayInstruction(MultiANewArrayInstruction obj)

Overrides:
  `enterMultiANewArrayInstruction` in class `BCVisitor`

### enterNewArrayInstruction

public void enterNewArrayInstruction(NewArrayInstruction obj)

Overrides:
  `enterNewArrayInstruction` in class `BCVisitor`

### enterPutFieldInstruction

public void enterPutFieldInstruction(PutFieldInstruction obj)

Overrides:
  `enterPutFieldInstruction` in class `BCVisitor`

### enterRetInstruction

public void enterRetInstruction(RetInstruction obj)

Overrides:
  `enterRetInstruction` in class `BCVisitor`

### enterStoreInstruction

public void enterStoreInstruction(StoreInstruction obj)

Overrides:
  `enterStoreInstruction` in class `BCVisitor`

### enterTableSwitchInstruction

public void enterTableSwitchInstruction(TableSwitchInstruction obj)

Overrides:
  `enterTableSwitchInstruction` in class `BCVisitor`

### enterWideInstruction

public void enterWideInstruction(WideInstruction obj)

Overrides:
  `enterWideInstruction` in class `BCVisitor`

### enterConstantPool

public void enterConstantPool(ConstantPool obj)

Overrides:
  `enterConstantPool` in class `BCVisitor`

### exitConstantPool

public void exitConstantPool(ConstantPool obj)

Overrides:
  `exitConstantPool` in class `BCVisitor`

### enterEntry

public void enterEntry(Entry obj)

Overrides:
  `enterEntry` in class `BCVisitor`

### exitEntry

public void exitEntry(Entry obj)

Overrides:
  `exitEntry` in class `BCVisitor`

### enterClassEntry

public void enterClassEntry(ClassEntry obj)

Overrides:
  `enterClassEntry` in class `BCVisitor`

### enterDoubleEntry

public void enterDoubleEntry(DoubleEntry obj)

Overrides:
  `enterDoubleEntry` in class `BCVisitor`

### enterFieldEntry

public void enterFieldEntry(FieldEntry obj)

Overrides:
  `enterFieldEntry` in class `BCVisitor`

### enterFloatEntry

public void enterFloatEntry(FloatEntry obj)

Overrides:
  `enterFloatEntry` in class `BCVisitor`

### enterIntEntry

public void enterIntEntry(IntEntry obj)

Overrides:
  `enterIntEntry` in class `BCVisitor`

### enterInterfaceMethodEntry

public void enterInterfaceMethodEntry(InterfaceMethodEntry obj)

Overrides:
  `enterInterfaceMethodEntry` in class `BCVisitor`

### enterLongEntry

public void enterLongEntry(LongEntry obj)

Overrides:
  `enterLongEntry` in class `BCVisitor`

### enterMethodEntry

public void enterMethodEntry(MethodEntry obj)

Overrides:
  `enterMethodEntry` in class `BCVisitor`

### enterNameAndTypeEntry

public void enterNameAndTypeEntry(NameAndTypeEntry obj)

Overrides:
  `enterNameAndTypeEntry` in class `BCVisitor`

### enterStringEntry

public void enterStringEntry(StringEntry obj)

Overrides:
  `enterStringEntry` in class `BCVisitor`

### enterUTF8Entry

public void enterUTF8Entry(UTF8Entry obj)

Overrides:
  `enterUTF8Entry` in class `BCVisitor`