wt.tools.xref
Class CallGraph

java.lang.Object
  extended bywt.tools.xref.CallGraph
All Implemented Interfaces:
ProcessFileInterface

public class CallGraph
extends Object
implements ProcessFileInterface


Field Summary
 MethodHashOfVectors d_calledBy
          KEY contains PackageClassMethodSpec object VALUE contains a vector of references to Metho's in d_methodList that call this method
 ClassHashTable d_classList
          KEY contains PackageClassSpec object VALUE contains Class object
(package private)  Class d_currentClass
           
(package private)  String d_currentPackageName
           
 ClassHashOfVectors d_extendedBy
          KEY contains PackageClassSpec object VALUE contains a vector of references to Class's in d_classList that extend this class
 InterfaceHashOfVectors d_implementedBy
          KEY contains PackageInterfaceSpec VALUE contains vector of references to Interface's in d_interfaceList that implement this interface
(package private)  int d_indentLevel
           
(package private)  String d_indentString
           
 InterfaceHashTable d_interfaceList
          KEY contains PackageInterfaceSpec object VALUE contains Interface object
 Hashtable d_methodCalls
          KEY contains full signature of calling class VALUE contains vector of full signatures of called methods
 MethodHashTable d_methodList
          KEY contains PackageClassMethodSpec object VALUE contains Method object
(package private)  int d_outputLevel
           
 PackageHashtable d_packageList
          KEY contains a package name string like wt.query VALUE contains a Package object
 
Constructor Summary
CallGraph()
           
 
Method Summary
(package private)  void decreaseIndent()
           
 boolean directoryNameOk(String directoryName)
          this method is provided so that the application can validate whether or not the specified directory is ok or not
(package private)  void displayFields(ClassFile cf)
           
(package private)  void displayInterfaces(ClassFile cf)
           
(package private)  void displayMethods(ClassFile cf)
           
(package private)  void displaySuperClass(ClassFile cf)
           
 boolean fileTypeOk(String fileName)
          This method is provided for the developer in case they do not want to process every single file in every directory.
(package private)  LineNumberProgramCounter[] getLineNumbers(CodeAttrInfo cai)
           
(package private)  String getMethodSignature(MethodInfo mi, boolean includeClassName)
           
(package private)  int getSourceLineNumber(LineNumberProgramCounter[] lnpc, int pc)
           
(package private)  void increaseIndent()
           
(package private)  void Log(String msg)
           
static void main(String[] args)
           
(package private)  void processCode(ClassFile cf, CodeAttrInfo cai, Method method)
           
 void processDirectory(String directoryName)
          This method is provided for the developer in case they want to do something each time they enter a new directory
(package private)  void processException(ClassFile cf, ExceptionAttrInfo eai)
           
 void processFile(String className)
          this method is provided for the developer in case they want to do something each time a file is encountered in a directory.
(package private)  void processGetField(ClassFile cf, CodeAttrInfo cai)
           
(package private)  void processInstantiations(ClassFile cf, CodeAttrInfo cai)
           
(package private)  void processLocalVariables(ClassFile cf, CodeAttrInfo cai)
           
(package private)  void processMethodCalls(ClassFile cf, CodeAttrInfo cai, boolean displayLocalCalls, Method currentMethod)
          if displayLocalCalls is true, then only output calls to methods in this class otherwise only output calls to methods not in this class.
(package private)  void processPutField(ClassFile cf, CodeAttrInfo cai)
           
(package private)  void run(String[] args)
          this method is used to run this class in stand-alone-mode in order to process a single class file
(package private)  void setOutputLevel(int level)
           
(package private)  void updateIndentString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

d_currentPackageName

String d_currentPackageName

d_currentClass

Class d_currentClass

d_packageList

public PackageHashtable d_packageList
KEY contains a package name string like wt.query VALUE contains a Package object


d_methodCalls

public Hashtable d_methodCalls
KEY contains full signature of calling class VALUE contains vector of full signatures of called methods


d_implementedBy

public InterfaceHashOfVectors d_implementedBy
KEY contains PackageInterfaceSpec VALUE contains vector of references to Interface's in d_interfaceList that implement this interface


d_extendedBy

public ClassHashOfVectors d_extendedBy
KEY contains PackageClassSpec object VALUE contains a vector of references to Class's in d_classList that extend this class


d_calledBy

public MethodHashOfVectors d_calledBy
KEY contains PackageClassMethodSpec object VALUE contains a vector of references to Metho's in d_methodList that call this method


d_classList

public ClassHashTable d_classList
KEY contains PackageClassSpec object VALUE contains Class object


d_interfaceList

public InterfaceHashTable d_interfaceList
KEY contains PackageInterfaceSpec object VALUE contains Interface object


d_methodList

public MethodHashTable d_methodList
KEY contains PackageClassMethodSpec object VALUE contains Method object


d_outputLevel

int d_outputLevel

d_indentLevel

int d_indentLevel

d_indentString

String d_indentString
Constructor Detail

CallGraph

public CallGraph()
Method Detail

updateIndentString

void updateIndentString()

increaseIndent

void increaseIndent()

decreaseIndent

void decreaseIndent()

setOutputLevel

void setOutputLevel(int level)

Log

void Log(String msg)

processDirectory

public void processDirectory(String directoryName)
Description copied from interface: ProcessFileInterface
This method is provided for the developer in case they want to do something each time they enter a new directory

Specified by:
processDirectory in interface ProcessFileInterface

directoryNameOk

public boolean directoryNameOk(String directoryName)
Description copied from interface: ProcessFileInterface
this method is provided so that the application can validate whether or not the specified directory is ok or not

Specified by:
directoryNameOk in interface ProcessFileInterface

getSourceLineNumber

int getSourceLineNumber(LineNumberProgramCounter[] lnpc,
                        int pc)

getLineNumbers

LineNumberProgramCounter[] getLineNumbers(CodeAttrInfo cai)

processGetField

void processGetField(ClassFile cf,
                     CodeAttrInfo cai)

processPutField

void processPutField(ClassFile cf,
                     CodeAttrInfo cai)

processLocalVariables

void processLocalVariables(ClassFile cf,
                           CodeAttrInfo cai)

processException

void processException(ClassFile cf,
                      ExceptionAttrInfo eai)

processInstantiations

void processInstantiations(ClassFile cf,
                           CodeAttrInfo cai)

processMethodCalls

void processMethodCalls(ClassFile cf,
                        CodeAttrInfo cai,
                        boolean displayLocalCalls,
                        Method currentMethod)
if displayLocalCalls is true, then only output calls to methods in this class otherwise only output calls to methods not in this class.


processCode

void processCode(ClassFile cf,
                 CodeAttrInfo cai,
                 Method method)

getMethodSignature

String getMethodSignature(MethodInfo mi,
                          boolean includeClassName)

displayMethods

void displayMethods(ClassFile cf)

displayFields

void displayFields(ClassFile cf)

displaySuperClass

void displaySuperClass(ClassFile cf)

displayInterfaces

void displayInterfaces(ClassFile cf)

fileTypeOk

public boolean fileTypeOk(String fileName)
Description copied from interface: ProcessFileInterface
This method is provided for the developer in case they do not want to process every single file in every directory. They can then use this method to filter out the files they do not want to process.

Specified by:
fileTypeOk in interface ProcessFileInterface

processFile

public void processFile(String className)
Description copied from interface: ProcessFileInterface
this method is provided for the developer in case they want to do something each time a file is encountered in a directory.

Specified by:
processFile in interface ProcessFileInterface

run

void run(String[] args)
this method is used to run this class in stand-alone-mode in order to process a single class file


main

public static void main(String[] args)