Class ClassDependencies

java.lang.Object
eu.bandm.tools.util3.ClassDependencies

public class ClassDependencies extends Object
// 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 Details

  • Constructor Details

    • ClassDependencies

      public ClassDependencies()
  • Method Details

    • printTransPackage

      public void printTransPackage(Collection<String> pkg)
      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 variables uses, generatedBy, readsEnvironment, readsProperty, and cycleReasons.
      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.
    • 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
    • SPECIAL_COLLECTION_FILTER

      protected void SPECIAL_COLLECTION_FILTER()
    • main

      public static void main(String[] args) throws IOException, ClassNotFoundException
      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