classycle.dependency
Class DependencyChecker

java.lang.Object
  extended by classycle.dependency.DependencyChecker

public class DependencyChecker
extends java.lang.Object

Checks a class graph for unwanted dependencies. The dependencies are described by a dependency definition file (.ddf).

Author:
Franz-Josef Elmer

Constructor Summary
DependencyChecker(Analyser analyser, java.lang.String dependencyDefinition, java.util.Map properties, ResultRenderer renderer)
          Creates a new instance.
 
Method Summary
 Result check()
          Checks the graph.
 boolean check(java.io.PrintWriter writer)
          Checks the graph and write unwanted dependencies onto the specified writer.
static void main(java.lang.String[] args)
          Runs the DependencyChecker application.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DependencyChecker

public DependencyChecker(Analyser analyser,
                         java.lang.String dependencyDefinition,
                         java.util.Map 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 Detail

check

public boolean check(java.io.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(java.lang.String[] args)
Runs the DependencyChecker application. Exit 0 if no unwanted dependency found otherwise 1 is returned.