TechTrader Bytecode Toolkit

com.techtrader.modules.tools.bytecode.visitor
Class BCVisitor

java.lang.Object
  |
  +--com.techtrader.modules.tools.bytecode.visitor.BCVisitor
Direct Known Subclasses:
PrettyPrintVisitor

public class BCVisitor
extends Object

Base class for visitors on a bytecode class. The public visit method will traverse the object graph of the given entity, calling the enter* and exit* methods as it visits each object. The traversal is done depth-first. Subclasses should override only the methods for visiting the entities they are interested in. Whenever there is a general method (i.e. enter/exitEntry) as well as a more specific one (i.e. enter/exitStringEntry), the more general method will be called first, followed by a call on the correct specific method. Most subclasses will override either the general or specific cases, but not both.

Author:
Abe White

Constructor Summary
BCVisitor()
           
 
Method Summary
 void enterArrayLoadInstruction(ArrayLoadInstruction obj)
           
 void enterArrayStoreInstruction(ArrayStoreInstruction 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 enterCmpInstruction(CmpInstruction obj)
           
 void enterCode(Code obj)
           
 void enterConstantInstruction(ConstantInstruction obj)
           
 void enterConstantPool(ConstantPool obj)
           
 void enterConstantValueAttribute(ConstantValueAttribute obj)
           
 void enterConvertInstruction(ConvertInstruction obj)
           
 void enterDeprecatedAttribute(DeprecatedAttribute obj)
           
 void enterDoubleEntry(DoubleEntry obj)
           
 void enterEntry(Entry obj)
           
 void enterExceptionHandler(ExceptionHandler obj)
           
 void enterExceptionsAttribute(ExceptionsAttribute obj)
           
 void enterFieldEntry(FieldEntry obj)
           
 void enterFloatEntry(FloatEntry obj)
           
 void enterGetFieldInstruction(GetFieldInstruction obj)
           
 void enterIIncInstruction(IIncInstruction obj)
           
 void enterInnerClass(InnerClass obj)
           
 void enterInnerClassesAttribute(InnerClassesAttribute obj)
           
 void enterInstruction(Instruction obj)
           
 void enterIntEntry(IntEntry obj)
           
 void enterInterfaceMethodEntry(InterfaceMethodEntry obj)
           
 void enterJumpInstruction(JumpInstruction obj)
           
 void enterLineNumber(LineNumber obj)
           
 void enterLineNumberTableAttribute(LineNumberTableAttribute obj)
           
 void enterLoadInstruction(LoadInstruction obj)
           
 void enterLocalVariable(LocalVariable obj)
           
 void enterLocalVariableTableAttribute(LocalVariableTableAttribute obj)
           
 void enterLongEntry(LongEntry obj)
           
 void enterLookupSwitchInstruction(LookupSwitchInstruction obj)
           
 void enterMathInstruction(MathInstruction obj)
           
 void enterMethodEntry(MethodEntry obj)
           
 void enterMethodInstruction(MethodInstruction obj)
           
 void enterMonitorEnterInstruction(MonitorEnterInstruction obj)
           
 void enterMonitorExitInstruction(MonitorExitInstruction obj)
           
 void enterMultiANewArrayInstruction(MultiANewArrayInstruction obj)
           
 void enterNameAndTypeEntry(NameAndTypeEntry obj)
           
 void enterNewArrayInstruction(NewArrayInstruction obj)
           
 void enterPlaceHolderEntry(PlaceHolderEntry obj)
           
 void enterPutFieldInstruction(PutFieldInstruction obj)
           
 void enterRetInstruction(RetInstruction obj)
           
 void enterReturnInstruction(ReturnInstruction obj)
           
 void enterSourceFileAttribute(SourceFileAttribute obj)
           
 void enterStackInstruction(StackInstruction obj)
           
 void enterStoreInstruction(StoreInstruction obj)
           
 void enterStringEntry(StringEntry obj)
           
 void enterSyntheticAttribute(SyntheticAttribute obj)
           
 void enterTableSwitchInstruction(TableSwitchInstruction obj)
           
 void enterUnknownAttribute(UnknownAttribute obj)
           
 void enterUTF8Entry(UTF8Entry obj)
           
 void enterWideInstruction(WideInstruction obj)
           
 void exitArrayLoadInstruction(ArrayLoadInstruction obj)
           
 void exitArrayStoreInstruction(ArrayStoreInstruction obj)
           
 void exitAttribute(Attribute obj)
           
 void exitBCClass(BCClass obj)
           
 void exitBCField(BCField obj)
           
 void exitBCMethod(BCMethod obj)
           
 void exitClassEntry(ClassEntry obj)
           
 void exitClassInstruction(ClassInstruction obj)
           
 void exitCmpInstruction(CmpInstruction obj)
           
 void exitCode(Code obj)
           
 void exitConstantInstruction(ConstantInstruction obj)
           
 void exitConstantPool(ConstantPool obj)
           
 void exitConstantValueAttribute(ConstantValueAttribute obj)
           
 void exitConvertInstruction(ConvertInstruction obj)
           
 void exitDeprecatedAttribute(DeprecatedAttribute obj)
           
 void exitDoubleEntry(DoubleEntry obj)
           
 void exitEntry(Entry obj)
           
 void exitExceptionHandler(ExceptionHandler obj)
           
 void exitExceptionsAttribute(ExceptionsAttribute obj)
           
 void exitFieldEntry(FieldEntry obj)
           
 void exitFloatEntry(FloatEntry obj)
           
 void exitGetFieldInstruction(GetFieldInstruction obj)
           
 void exitIIncInstruction(IIncInstruction obj)
           
 void exitInnerClass(InnerClass obj)
           
 void exitInnerClassesAttribute(InnerClassesAttribute obj)
           
 void exitInstruction(Instruction obj)
           
 void exitIntEntry(IntEntry obj)
           
 void exitInterfaceMethodEntry(InterfaceMethodEntry obj)
           
 void exitJumpInstruction(JumpInstruction obj)
           
 void exitLineNumber(LineNumber obj)
           
 void exitLineNumberTableAttribute(LineNumberTableAttribute obj)
           
 void exitLoadInstruction(LoadInstruction obj)
           
 void exitLocalVariable(LocalVariable obj)
           
 void exitLocalVariableTableAttribute(LocalVariableTableAttribute obj)
           
 void exitLongEntry(LongEntry obj)
           
 void exitLookupSwitchInstruction(LookupSwitchInstruction obj)
           
 void exitMathInstruction(MathInstruction obj)
           
 void exitMethodEntry(MethodEntry obj)
           
 void exitMethodInstruction(MethodInstruction obj)
           
 void exitMonitorEnterInstruction(MonitorEnterInstruction obj)
           
 void exitMonitorExitInstruction(MonitorExitInstruction obj)
           
 void exitMultiANewArrayInstruction(MultiANewArrayInstruction obj)
           
 void exitNameAndTypeEntry(NameAndTypeEntry obj)
           
 void exitNewArrayInstruction(NewArrayInstruction obj)
           
 void exitPlaceHolderEntry(PlaceHolderEntry obj)
           
 void exitPutFieldInstruction(PutFieldInstruction obj)
           
 void exitRetInstruction(RetInstruction obj)
           
 void exitReturnInstruction(ReturnInstruction obj)
           
 void exitSourceFileAttribute(SourceFileAttribute obj)
           
 void exitStackInstruction(StackInstruction obj)
           
 void exitStoreInstruction(StoreInstruction obj)
           
 void exitStringEntry(StringEntry obj)
           
 void exitSyntheticAttribute(SyntheticAttribute obj)
           
 void exitTableSwitchInstruction(TableSwitchInstruction obj)
           
 void exitUnknownAttribute(UnknownAttribute obj)
           
 void exitUTF8Entry(UTF8Entry obj)
           
 void exitWideInstruction(WideInstruction obj)
           
 void visit(VisitAcceptor obj)
          Visit the given entity.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

BCVisitor

public BCVisitor()
Method Detail

visit

public void visit(VisitAcceptor obj)
Visit the given entity.

enterBCClass

public void enterBCClass(BCClass obj)

exitBCClass

public void exitBCClass(BCClass obj)

enterBCField

public void enterBCField(BCField obj)

exitBCField

public void exitBCField(BCField obj)

enterBCMethod

public void enterBCMethod(BCMethod obj)

exitBCMethod

public void exitBCMethod(BCMethod obj)

enterAttribute

public void enterAttribute(Attribute obj)

exitAttribute

public void exitAttribute(Attribute obj)

enterConstantValueAttribute

public void enterConstantValueAttribute(ConstantValueAttribute obj)

exitConstantValueAttribute

public void exitConstantValueAttribute(ConstantValueAttribute obj)

enterDeprecatedAttribute

public void enterDeprecatedAttribute(DeprecatedAttribute obj)

exitDeprecatedAttribute

public void exitDeprecatedAttribute(DeprecatedAttribute obj)

enterExceptionsAttribute

public void enterExceptionsAttribute(ExceptionsAttribute obj)

exitExceptionsAttribute

public void exitExceptionsAttribute(ExceptionsAttribute obj)

enterInnerClassesAttribute

public void enterInnerClassesAttribute(InnerClassesAttribute obj)

exitInnerClassesAttribute

public void exitInnerClassesAttribute(InnerClassesAttribute obj)

enterLineNumberTableAttribute

public void enterLineNumberTableAttribute(LineNumberTableAttribute obj)

exitLineNumberTableAttribute

public void exitLineNumberTableAttribute(LineNumberTableAttribute obj)

enterLocalVariableTableAttribute

public void enterLocalVariableTableAttribute(LocalVariableTableAttribute obj)

exitLocalVariableTableAttribute

public void exitLocalVariableTableAttribute(LocalVariableTableAttribute obj)

enterSourceFileAttribute

public void enterSourceFileAttribute(SourceFileAttribute obj)

exitSourceFileAttribute

public void exitSourceFileAttribute(SourceFileAttribute obj)

enterSyntheticAttribute

public void enterSyntheticAttribute(SyntheticAttribute obj)

exitSyntheticAttribute

public void exitSyntheticAttribute(SyntheticAttribute obj)

enterUnknownAttribute

public void enterUnknownAttribute(UnknownAttribute obj)

exitUnknownAttribute

public void exitUnknownAttribute(UnknownAttribute obj)

enterCode

public void enterCode(Code obj)

exitCode

public void exitCode(Code obj)

enterExceptionHandler

public void enterExceptionHandler(ExceptionHandler obj)

exitExceptionHandler

public void exitExceptionHandler(ExceptionHandler obj)

enterInnerClass

public void enterInnerClass(InnerClass obj)

exitInnerClass

public void exitInnerClass(InnerClass obj)

enterLineNumber

public void enterLineNumber(LineNumber obj)

exitLineNumber

public void exitLineNumber(LineNumber obj)

enterLocalVariable

public void enterLocalVariable(LocalVariable obj)

exitLocalVariable

public void exitLocalVariable(LocalVariable obj)

enterInstruction

public void enterInstruction(Instruction obj)

exitInstruction

public void exitInstruction(Instruction obj)

enterArrayLoadInstruction

public void enterArrayLoadInstruction(ArrayLoadInstruction obj)

exitArrayLoadInstruction

public void exitArrayLoadInstruction(ArrayLoadInstruction obj)

enterArrayStoreInstruction

public void enterArrayStoreInstruction(ArrayStoreInstruction obj)

exitArrayStoreInstruction

public void exitArrayStoreInstruction(ArrayStoreInstruction obj)

enterClassInstruction

public void enterClassInstruction(ClassInstruction obj)

exitClassInstruction

public void exitClassInstruction(ClassInstruction obj)

enterConstantInstruction

public void enterConstantInstruction(ConstantInstruction obj)

exitConstantInstruction

public void exitConstantInstruction(ConstantInstruction obj)

enterConvertInstruction

public void enterConvertInstruction(ConvertInstruction obj)

exitConvertInstruction

public void exitConvertInstruction(ConvertInstruction obj)

enterGetFieldInstruction

public void enterGetFieldInstruction(GetFieldInstruction obj)

exitGetFieldInstruction

public void exitGetFieldInstruction(GetFieldInstruction obj)

enterIIncInstruction

public void enterIIncInstruction(IIncInstruction obj)

exitIIncInstruction

public void exitIIncInstruction(IIncInstruction obj)

enterJumpInstruction

public void enterJumpInstruction(JumpInstruction obj)

exitJumpInstruction

public void exitJumpInstruction(JumpInstruction obj)

enterLoadInstruction

public void enterLoadInstruction(LoadInstruction obj)

exitLoadInstruction

public void exitLoadInstruction(LoadInstruction obj)

enterLookupSwitchInstruction

public void enterLookupSwitchInstruction(LookupSwitchInstruction obj)

exitLookupSwitchInstruction

public void exitLookupSwitchInstruction(LookupSwitchInstruction obj)

enterMathInstruction

public void enterMathInstruction(MathInstruction obj)

exitMathInstruction

public void exitMathInstruction(MathInstruction obj)

enterMethodInstruction

public void enterMethodInstruction(MethodInstruction obj)

exitMethodInstruction

public void exitMethodInstruction(MethodInstruction obj)

enterMultiANewArrayInstruction

public void enterMultiANewArrayInstruction(MultiANewArrayInstruction obj)

exitMultiANewArrayInstruction

public void exitMultiANewArrayInstruction(MultiANewArrayInstruction obj)

enterNewArrayInstruction

public void enterNewArrayInstruction(NewArrayInstruction obj)

exitNewArrayInstruction

public void exitNewArrayInstruction(NewArrayInstruction obj)

enterPutFieldInstruction

public void enterPutFieldInstruction(PutFieldInstruction obj)

exitPutFieldInstruction

public void exitPutFieldInstruction(PutFieldInstruction obj)

enterRetInstruction

public void enterRetInstruction(RetInstruction obj)

exitRetInstruction

public void exitRetInstruction(RetInstruction obj)

enterReturnInstruction

public void enterReturnInstruction(ReturnInstruction obj)

exitReturnInstruction

public void exitReturnInstruction(ReturnInstruction obj)

enterStackInstruction

public void enterStackInstruction(StackInstruction obj)

exitStackInstruction

public void exitStackInstruction(StackInstruction obj)

enterStoreInstruction

public void enterStoreInstruction(StoreInstruction obj)

exitStoreInstruction

public void exitStoreInstruction(StoreInstruction obj)

enterTableSwitchInstruction

public void enterTableSwitchInstruction(TableSwitchInstruction obj)

exitTableSwitchInstruction

public void exitTableSwitchInstruction(TableSwitchInstruction obj)

enterWideInstruction

public void enterWideInstruction(WideInstruction obj)

exitWideInstruction

public void exitWideInstruction(WideInstruction obj)

enterMonitorEnterInstruction

public void enterMonitorEnterInstruction(MonitorEnterInstruction obj)

exitMonitorEnterInstruction

public void exitMonitorEnterInstruction(MonitorEnterInstruction obj)

enterMonitorExitInstruction

public void enterMonitorExitInstruction(MonitorExitInstruction obj)

exitMonitorExitInstruction

public void exitMonitorExitInstruction(MonitorExitInstruction obj)

enterCmpInstruction

public void enterCmpInstruction(CmpInstruction obj)

exitCmpInstruction

public void exitCmpInstruction(CmpInstruction obj)

enterConstantPool

public void enterConstantPool(ConstantPool obj)

exitConstantPool

public void exitConstantPool(ConstantPool obj)

enterEntry

public void enterEntry(Entry obj)

exitEntry

public void exitEntry(Entry obj)

enterClassEntry

public void enterClassEntry(ClassEntry obj)

exitClassEntry

public void exitClassEntry(ClassEntry obj)

enterDoubleEntry

public void enterDoubleEntry(DoubleEntry obj)

exitDoubleEntry

public void exitDoubleEntry(DoubleEntry obj)

enterFieldEntry

public void enterFieldEntry(FieldEntry obj)

exitFieldEntry

public void exitFieldEntry(FieldEntry obj)

enterFloatEntry

public void enterFloatEntry(FloatEntry obj)

exitFloatEntry

public void exitFloatEntry(FloatEntry obj)

enterIntEntry

public void enterIntEntry(IntEntry obj)

exitIntEntry

public void exitIntEntry(IntEntry obj)

enterInterfaceMethodEntry

public void enterInterfaceMethodEntry(InterfaceMethodEntry obj)

exitInterfaceMethodEntry

public void exitInterfaceMethodEntry(InterfaceMethodEntry obj)

enterLongEntry

public void enterLongEntry(LongEntry obj)

exitLongEntry

public void exitLongEntry(LongEntry obj)

enterMethodEntry

public void enterMethodEntry(MethodEntry obj)

exitMethodEntry

public void exitMethodEntry(MethodEntry obj)

enterNameAndTypeEntry

public void enterNameAndTypeEntry(NameAndTypeEntry obj)

exitNameAndTypeEntry

public void exitNameAndTypeEntry(NameAndTypeEntry obj)

enterPlaceHolderEntry

public void enterPlaceHolderEntry(PlaceHolderEntry obj)

exitPlaceHolderEntry

public void exitPlaceHolderEntry(PlaceHolderEntry obj)

enterStringEntry

public void enterStringEntry(StringEntry obj)

exitStringEntry

public void exitStringEntry(StringEntry obj)

enterUTF8Entry

public void enterUTF8Entry(UTF8Entry obj)

exitUTF8Entry

public void exitUTF8Entry(UTF8Entry obj)

TechTrader Bytecode Toolkit