ch.elca.dependency.core
Class Analyzer

java.lang.Object
  |
  +--ch.elca.dependency.core.Analyzer

public class Analyzer
extends java.lang.Object

This class is the main responsible one for parsing the whole class structure in the directory tree. It uses the Reader class for reading the class files contained by the class structure. Every file in the directory structure is parsed recursively if it is a java class file. This is determined by looking at the file extension of the corresponding file. If a file has no file extension the type cannot be determined and so it will not be parsed as a java class file. Because sometimes in a large project there are many files with partially no file extension, there are two possibilities for handling this case.

The files with no file extension can be skipped and are not included in the analyse. Or the whole analyse can be canceled with a corresponding message to the user. This behaviour is specified by the third argument (boolean) in the constructor of this class. If the argument is true, file extensions are required and if there is a file without any, the application is stopped. If this argument is false all the files with no file extension are just skipped and the analyse is performed whithout these files.

Version:
1.0-beta
Author:
Christoph Trutmann
See Also:
Reader, RawModel, Filter

Constructor Summary
Analyzer(java.io.File root, Filter filter)
          Creates a new Analyzer instance.
 
Method Summary
 void analyse()
          Performs the analyse on the specified directory root in the constructor.
 java.util.HashMap getClassInfos()
          Gets all the ClassInfo objects which have passed the load filter.
 java.util.HashMap getDependencies()
          Gets the dependencies encountered by the analyse.
 java.io.File getProjectRoot()
          Get the project root file.
 Statistic getStatistics()
          Gets the Statistic object containing all the statistical data gained from the analyse.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Analyzer

public Analyzer(java.io.File root,
                Filter filter)
         throws AnalyseException
Creates a new Analyzer instance.

Parameters:
root - a File value
filter - a Filter value
Throws:
AnalyseException - if an error occurs
Method Detail

analyse

public void analyse()
             throws AnalyseException
Performs the analyse on the specified directory root in the constructor.

AnalyseException

getDependencies

public java.util.HashMap getDependencies()
                                  throws AnalyseException
Gets the dependencies encountered by the analyse.

Returns:
A HashTable containing all the packages dependencies.
AnalyseException

getClassInfos

public java.util.HashMap getClassInfos()
Gets all the ClassInfo objects which have passed the load filter.

Returns:
List containing all the ClassInfo objects of this project which have passed the load filter.

getStatistics

public Statistic getStatistics()
                        throws AnalyseException
Gets the Statistic object containing all the statistical data gained from the analyse.

Returns:
Statistic object contining all the statistcal data gained from the analyse.
Throws:
AnalyseException - If the 'analyse()' method was not called before.

getProjectRoot

public java.io.File getProjectRoot()
Get the project root file.

Returns:
a File value


Copyright © 2003 ELCA Informatique SA. All Rights Reserved.