org.fuin.units4j.dependency
Class DependencyAnalyzer

java.lang.Object
  extended by org.fuin.units4j.dependency.DependencyAnalyzer

public final class DependencyAnalyzer
extends java.lang.Object

Analyzes package dependencies.


Constructor Summary
DependencyAnalyzer(Dependencies dependencies)
          Constructor with dependency definition.
DependencyAnalyzer(java.io.File dependenciesFile)
          Constructor with XML file.
 
Method Summary
 void analyze(java.io.File classesDir)
          Analyze the dependencies for all classes in the directory and it's sub directories.
 java.util.List<DependencyError> getDependencyErrors()
          Returns the list of dependency errors from last call to analyze(File).
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DependencyAnalyzer

public DependencyAnalyzer(java.io.File dependenciesFile)
                   throws InvalidDependenciesDefinitionException
Constructor with XML file.

Parameters:
dependenciesFile - XML file with allowed or forbidden dependencies - Cannot be null.
Throws:
InvalidDependenciesDefinitionException - Formal correct (XML) but invalid dependency definition.

DependencyAnalyzer

public DependencyAnalyzer(Dependencies dependencies)
                   throws InvalidDependenciesDefinitionException
Constructor with dependency definition.

Parameters:
dependencies - Definition of allowed or forbidden dependencies - Cannot be null.
Throws:
InvalidDependenciesDefinitionException - Formal correct (XML) but invalid dependency definition.
Method Detail

analyze

public final void analyze(java.io.File classesDir)
                   throws java.io.IOException
Analyze the dependencies for all classes in the directory and it's sub directories.

Parameters:
classesDir - Directory where the "*.class" files are located (something like "bin" or "classes").
Throws:
java.io.IOException - Error reading the classes.

getDependencyErrors

public final java.util.List<DependencyError> getDependencyErrors()
Returns the list of dependency errors from last call to analyze(File).

Returns:
List of errors - Always non-null but may be empty.


Copyright © 2010 Future Invent Informationsmanagement GmbH. All Rights Reserved.