Package eu.bandm.tools.util3
Class ClassDependencies
java.lang.Object
eu.bandm.tools.util3.ClassDependencies
// FIXME tree/subset pairs necessary !?!? Classname stored in .class ?
// FIXME give filenames as CLI-parameters !?
// FIXME give first/latest generation as CLI-parameters !?
FIXME DOC
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final Stringstatic final String[]HACK FIXME RAUS ! According to Makefile as of 20240124Maps a class to the given reason.static final Stringstatic final Stringstatic final intMaps a class to its generator, as named in the annotation.static final Stringstatic final Stringstatic final Stringstatic final Stringstatic final StringMaps a calling class to a called class. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidBreak some bootstrap-cycles introduced by backward code-patching in the metatools make-based architecture.voidMake the analysis and print results to files.voidcollectClasses(String[] roots, Predicate<String> filter) Visit all files the names of which end with ".class" in the given directory trees and extracts info from their contents.static voidCommand line tool which analyses the relations between the class files contained in the given root directories.voidPrint a cycle between different packages (which can only be compiled by irregular compiler usage) and the class relations which cross package limits.protected void
-
Field Details
-
ALLPACKAGES
- See Also:
-
INNER_CLASS_SEPARATOR
- See Also:
-
FILENAME_DIAGRAM
- See Also:
-
FILENAME_ANALYSES
- See Also:
-
TOOL_UMOD
- See Also:
-
TOOL_TDOM_BOOT
- See Also:
-
TOOL_TDOM
- See Also:
-
GENERATOR_REPRESENTATIVE
- See Also:
-
between_lljava_live_BOOT_and_lljava_live
HACK FIXME RAUS ! According to Makefile as of 20240124 -
uses
Maps a calling class to a called class. -
generatedBy
Maps a class to its generator, as named in the annotation. -
cycleReasons
Maps a class to the given reason. All marked classes are in the keySet. Empty string is possible as value. -
FIRST_COLUMN_WIDTH
public static final int FIRST_COLUMN_WIDTH- See Also:
-
bandmClasses
-
-
Constructor Details
-
ClassDependencies
public ClassDependencies()
-
-
Method Details
-
printTransPackage
Print a cycle between different packages (which can only be compiled by irregular compiler usage) and the class relations which cross package limits.- Parameters:
pkg- packages involved
-
collectClasses
public void collectClasses(String[] roots, Predicate<String> filter) throws IOException, ClassNotFoundException Visit all files the names of which end with ".class" in the given directory trees and extracts info from their contents. Store the result in the global variablesuses,generatedBy,readsEnvironment,readsProperty, andcycleReasons.- Parameters:
roots- list of pairs: each one directory of class files and one sub-directory, or »-«.filter- on the names of the classes to select the analysed classes.- Throws:
IOExceptionClassNotFoundException
-
adjustMetatoolsHacks_1
public void adjustMetatoolsHacks_1()Break some bootstrap-cycles introduced by backward code-patching in the metatools make-based architecture. Assume that "generatedBy" is still relevant and has not yet been added to "uses" or "package2package", etc. -
analyze
public void analyze(String[] roots, Predicate<String> filter) throws IOException, ClassNotFoundException Make the analysis and print results to files.- Parameters:
roots- list of pairs: directories of class files and their sub-directories or »-«filter- on the names of the classes to select the analysed classes- Throws:
IOExceptionClassNotFoundException
-
SPECIAL_COLLECTION_FILTER
protected void SPECIAL_COLLECTION_FILTER() -
main
Command line tool which analyses the relations between the class files contained in the given root directories. Generates two files with fixed names in the working directory, namely "classUsageAnalyses.xml" and "packageDependencyDiagram.html".- Parameters:
args- sequence of PAIRS of Strings. The first gives a top-of-classtree directory as it appears in a Java classpath. The second is "-" for "all files", or a subdirectory which further restricts the analyzed packages. Both use "/" as separator. ((FIXME auch Windows??))Example restricting the analysed source tree:
bandm/tools/util3$ make run_ClassDependencies RUN_PARAMS="~/metatools/lib/classes eu/bandm/tools/util3"
Example without restriction:bandm/tools/util3$ make run_ClassDependencies RUN_PARAMS="~/metatools/lib/classes -"- Throws:
IOExceptionClassNotFoundException
-