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
Modifier and TypeFieldDescriptionstatic final String
static final String[]
HACK FIXME RAUS ! According to Makefile as of 20240124(package private) int
Number of current chapter in the XML analysis output.Maps a class to the given reason.static final String
static final String
Maps a class to its generator, as named in the annotation.Maps a class to its early generation number.Maps a class to its late generation number.static final String
static final String
Maps a calling package to a called package.(package private) PrintWriter
Output to the generated xml file with tabular data.Maps a class to a read envirnonment variable, as named in the annotation.Maps a class to a read (Java system) property, as named in the annotation.static final String
static final String
static final String
Maps a calling class to a called class. -
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
Break some bootstrap-cycles introduced by backward code-patching in the metatools make-based architecture.void
Make the analysis and print results to files.(package private) void
chapter
(PrintWriter pw, String s) Print the heading of a chapter in the XML analysis output.void
collectClasses
(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.(package private) String
Bring the name of the classes into a field of fixed width for the leftmost column of the HTML output.static void
Command line tool which analyses the relations between the class files contained in the given root directories.(package private) void
(package private) void
Print the interactive import graph into a HTML table and install the necessary CSS and JS files.(package private) void
printList
(PrintWriter pw, String indent, Collection<String> data) Print an alphabetically sorted list of qualified class names.(package private) void
Prints reading of Java system properties and envirnonment variables the the analysis file.void
Print a cycle between different packages (which can only be compiled by irregular compiler usage) and the class relations which cross package limits.(package private) void
Execute analysis for cyclic imports between classes and packages.
-
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. -
package2package
Maps a calling package to a called package. -
generatedBy
Maps a class to its generator, as named in the annotation. -
readsProperty
Maps a class to a read (Java system) property, as named in the annotation. -
readsEnvironment
Maps a class to a read envirnonment variable, 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. -
generations_early
Maps a class to its early generation number. -
generations_late
Maps a class to its late generation number. -
pwa
PrintWriter pwaOutput to the generated xml file with tabular data. -
cnum
int cnumNumber of current chapter in the XML analysis output. -
bandmClasses
-
-
Constructor Details
-
ClassDependencies
public ClassDependencies()
-
-
Method Details
-
chapter
Print the heading of a chapter in the XML analysis output. GLO INcnum
-
printList
Print an alphabetically sorted list of qualified class names. Separate them by one blank or newline. Asserts to start and stop working at the beginning of a line. -
formatNameColumn
Bring the name of the classes into a field of fixed width for the leftmost column of the HTML output. -
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:
IOException
ClassNotFoundException
-
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. -
printUsageAndCycles
void printUsageAndCycles()Execute analysis for cyclic imports between classes and packages. Print annotation information and the found cycles to the output file. -
printProperties
void printProperties()Prints reading of Java system properties and envirnonment variables the the analysis file. -
makeGenerations
void makeGenerations() -
printInteractiveHTML
Print the interactive import graph into a HTML table and install the necessary CSS and JS files.- Throws:
IOException
-
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:
IOException
ClassNotFoundException
-
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:
IOException
ClassNotFoundException
-