|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectwt.tools.xref.pdl
This class creates a Package Dependency List in a particular codebase Two inner classes, Phase1 and Phase2 are used to encapsulate the functionality required by two distinct phases. TO DO: From Ben Grommes: Need to add code that watches for use of the instanceof operator in the bytecode as another source of class/package dependency information. DONE! From Mike Murray: The next helpful step would be to see what kind of package layering there is. (I know it is currently one big ball of circular dependencies.) Maybe it would be helpful to identify what packages each package is not directly, or indirectly, depend on. :o) More seriously, it might be informative to see the list of all indirect dependencies also. That would be quite telling regarding the ball that we have created. From Tim David: I would like a feature so I could see just the other packages a specific Windchill package is dependent upon, instead of the classes. This would be useful in creating package diagrams for Rose. Kevin Hedrick: It would be nice to see specific classes in the left hand pane, and it would also be nice to be able to click on any class in the right hand pane. In any case, I have been thinking that we should use a tool like this to assign each class a number. Each class gets 1 point for all of its dependent classes, and 1 point for each of its dependent classes and so on- like a pyrmid scheme. Then we have a pretty concrete way of knowing how risky a change is. I responded to Kevin, suggesting a 3-pane Javadoc 1.2 like display with 1) packages in the upper left 2) classes/interfaces for package in lower left 3) dependent classes for selected class in main pane
Nested Class Summary | |
(package private) class |
pdl.Phase1
In phase 1 we simply go through the entire codebase, reading all of the .class files to determine whether to add each class into the class list or the interface list. |
(package private) class |
pdl.Phase2
In phase 2 we go through the entire codebase again and get the dependent classes for each class and store this information in a SimplePackage object. |
Field Summary | |
(package private) static Vector |
d_baseTypesList
This list contains the name of all the base data types and is used to skip these types when they are encountered in the Phase2.ProcessFile() method. |
(package private) static Hashtable |
d_classDeps
This contains is used to track dependencies between classes. |
(package private) static Vector |
d_classList
|
(package private) String |
d_currentPackageName
This field is used by multiple methods in this class. |
(package private) static boolean |
d_includeWindchillClassesOnly
|
(package private) static Hashtable |
d_interfaceDeps
This contains is used to track dependencies between interfaces The KEY is an interfaceSpec, the VALUE is an InterfaceDeps object. |
(package private) static Vector |
d_interfaceList
|
(package private) static String |
d_outputDirectory
|
(package private) static Hashtable |
d_packages
|
(package private) static String |
d_startingDirectory
|
Constructor Summary | |
pdl()
|
Method Summary | |
(package private) void |
addToMasterList(ClassFile cf,
String classSpec)
This convenience method checks to see if the current class is an INTERFACE or a CLASS and then adds it to the appropriate Vector. |
(package private) void |
deserialize()
|
(package private) void |
directoryCheck(String dirName)
|
boolean |
directoryNameOk(String directoryName)
Make sure the user specifies a directory in the Windchill codebase at the wt level or below |
(package private) void |
displayClassDeps(PrintWriter pw,
String classSpec)
This method locates the specified classSpec in d_classDeps and recurses 'upward' through the inheritance hierarchy all the way to java.lang.Object, displaying each class along the way. |
(package private) void |
displayInterfaceDeps(PrintWriter pw,
String interfaceSpec)
This method locates the specified interfaceSpec in d_interfaceDeps and recurses 'upward' through the inheritance hierarchy displaying each interface along the way. |
boolean |
fileTypeOk(String fileName)
This method acts like a filter so that only .class files are processed. |
(package private) void |
fillBaseTypesList()
|
static void |
main(String[] args)
|
(package private) void |
noneMsg(PrintWriter pw,
String title,
String noneMsg)
This is a simple convenience method used by summary(). |
(package private) void |
processCommandLineArgs(String[] args)
|
void |
processDirectory(String directoryName)
output the name of the package |
void |
processFile(String fileName)
This method is defined here to meet the requirements of the ProcessFileInterface interface BUT it doesn't do anything. |
(package private) void |
run(String[] args)
|
(package private) void |
serialize()
|
protected boolean |
skipThisClass(String dependentClassSpec)
This method is used to determine whether or not a particular class should be included in the dependency information containers. |
(package private) void |
summary()
This method outputs a summary of dependency information for all packages in the codebase. |
(package private) static void |
usage()
|
(package private) void |
writeHtml()
|
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
static boolean d_includeWindchillClassesOnly
static Vector d_interfaceList
static Vector d_classList
static Hashtable d_interfaceDeps
static Hashtable d_classDeps
static Hashtable d_packages
static String d_startingDirectory
static String d_outputDirectory
static Vector d_baseTypesList
String d_currentPackageName
Constructor Detail |
public pdl()
Method Detail |
void serialize()
void deserialize()
void addToMasterList(ClassFile cf, String classSpec)
public void processDirectory(String directoryName)
processDirectory
in interface ProcessFileInterface
public boolean directoryNameOk(String directoryName)
directoryNameOk
in interface ProcessFileInterface
public boolean fileTypeOk(String fileName)
fileTypeOk
in interface ProcessFileInterface
public void processFile(String fileName)
processFile
in interface ProcessFileInterface
protected boolean skipThisClass(String dependentClassSpec)
void noneMsg(PrintWriter pw, String title, String noneMsg)
void displayInterfaceDeps(PrintWriter pw, String interfaceSpec)
void displayClassDeps(PrintWriter pw, String classSpec)
void summary()
void writeHtml()
void directoryCheck(String dirName)
void processCommandLineArgs(String[] args)
void fillBaseTypesList()
void run(String[] args)
static void usage()
public static void main(String[] args)
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |