Class DependencyChecker

java.lang.Object
classycle.dependency.DependencyChecker

public class DependencyChecker extends Object
Checks a class graph for unwanted dependencies. The dependencies are described by a dependency definition file (.ddf).
Author:
Franz-Josef Elmer
  • Constructor Details

    • DependencyChecker

      public DependencyChecker(Analyser analyser, String dependencyDefinition, Map<Object,Object> properties, ResultRenderer renderer)
      Creates a new instance. Note, that the constructor does not create the graph. It only parses dependencyDefinition as a preprocessing step. The calculation of the graph is done in check(PrintWriter).
      Parameters:
      analyser - Analyzer instance.
      dependencyDefinition - Description (as read from a .ddf file) of the dependencies to be checked.
      renderer - Output renderer for unwanted dependencies found.
  • Method Details

    • check

      public boolean check(PrintWriter writer)
      Checks the graph and write unwanted dependencies onto the specified writer.
      Returns:
      true if no unwanted dependency has been found.
    • check

      public Result check()
      Checks the graph.
    • main

      public static void main(String[] args)
      Runs the DependencyChecker application. Exit 0 if no unwanted dependency found otherwise 1 is returned.