Docjar: A Java Source and Docuemnt Enginecom.*    java.*    javax.*    org.*    all    new    plug-in

Quick Search    Search Deep

ch.epfl.lamp.smartanalysis
Class ProjectAnalyser  view ProjectAnalyser download ProjectAnalyser.java

java.lang.Object
  extended bych.epfl.lamp.smartanalysis.ProjectAnalyser
Direct Known Subclasses:
SimpleProjectAnalyser, SmartProjectAnalyser

public abstract class ProjectAnalyser
extends java.lang.Object

A class analysing a classpath to find what class files/source were modified and what dependencies should also be recompiled.

Version:
1.0

Field Summary
protected  DepAnalyser analyser
          The analyzer used to analyze skeleton and dependencies.
private  java.io.File cacheFile
           
protected  java.util.Set deletion
          A list of classes that have been deleted.
protected  java.lang.String destPath
          the path where classes are compiled.
protected  Handle handle
          the handle to external functions.
protected  ClassList list
          the ClassList containing the graph.
private  boolean logAnalysis
           
protected  java.lang.String[] sourcePath
          the path where sources are stored.
 
Constructor Summary
ProjectAnalyser(java.io.File f, java.lang.String classPath, java.lang.String[] sourcePath, java.lang.String libPath, DepAnalyser analyser, boolean logAnalysis, Handle pro)
          Creates a new ProjectAnalyser instance from a cache file.
ProjectAnalyser(java.lang.String classPath, java.lang.String[] sourcePath, java.lang.String libPath, DepAnalyser analyser, boolean logAnalysis, Handle pro)
          Creates a new ProjectAnalyser instance.
 
Method Summary
protected  void analyseLog(DepClass dclass, java.lang.String log)
          log a message if logAnalysis is true.
protected  void analyseLog(java.lang.String log)
          log a message if logAnalysis is true.
protected  void cache()
          write the dependency graph to disk.
 void cache(java.io.File f)
          specify the file where to cache this analyser.
protected abstract  void classFileDeleted(DepClass dclass, java.io.File classFile)
          what should be done if a class file is deleted.
protected abstract  void classFileModified(DepClass dclass, java.io.File classFile)
          what should be done if a class file is modified.
 void done()
          we are done with this object.
protected  void finalize()
          Called on an object by the Virtual Machine at most once, at some point after the Object is determined unreachable but before it is destroyed.
protected  void findClassListModification()
          find the modification made to the classlist.
protected  void findModifiedSource()
          find the sources that have been modified since last run.
private  void findNewClass()
           
private  void findNewClass(ch.epfl.lamp.smartanalysis.util.AbstractFile f, java.lang.String path)
           
private  void makeGraph()
           
protected abstract  void newClassFile(java.lang.String className)
          a new class has been found.
protected abstract  void sourceFileModified(DepClass dclass, java.io.File sourceFile)
          what should be done if a source file is modified.
protected abstract  void sourceFileNotDefined(DepClass dclass)
          the source file for this class is not defined properly.
protected abstract  void sourceFileNotFound(DepClass dclass)
          the source file for this class has been deleted.
 void writeClassList(java.io.File f)
          write all definitions of the classes known by this project.
 
Methods inherited from class java.lang.Object
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

list

protected ClassList list
the ClassList containing the graph.


deletion

protected java.util.Set deletion
A list of classes that have been deleted.


analyser

protected DepAnalyser analyser
The analyzer used to analyze skeleton and dependencies.


cacheFile

private java.io.File cacheFile

logAnalysis

private boolean logAnalysis

handle

protected Handle handle
the handle to external functions.


sourcePath

protected java.lang.String[] sourcePath
the path where sources are stored.


destPath

protected java.lang.String destPath
the path where classes are compiled.

Constructor Detail

ProjectAnalyser

public ProjectAnalyser(java.lang.String classPath,
                       java.lang.String[] sourcePath,
                       java.lang.String libPath,
                       DepAnalyser analyser,
                       boolean logAnalysis,
                       Handle pro)
                throws java.io.IOException,
                       java.lang.ClassNotFoundException,
                       DuplicatedClassException,
                       ch.epfl.lamp.smartanalysis.util.FileNotFoundException
Creates a new ProjectAnalyser instance.


ProjectAnalyser

public ProjectAnalyser(java.io.File f,
                       java.lang.String classPath,
                       java.lang.String[] sourcePath,
                       java.lang.String libPath,
                       DepAnalyser analyser,
                       boolean logAnalysis,
                       Handle pro)
                throws java.io.FileNotFoundException,
                       java.io.IOException,
                       java.io.OptionalDataException,
                       java.lang.ClassNotFoundException,
                       java.lang.Exception
Creates a new ProjectAnalyser instance from a cache file.

Method Detail

analyseLog

protected void analyseLog(DepClass dclass,
                          java.lang.String log)
log a message if logAnalysis is true.


analyseLog

protected void analyseLog(java.lang.String log)
log a message if logAnalysis is true.


findClassListModification

protected void findClassListModification()
                                  throws java.io.IOException,
                                         java.lang.ClassNotFoundException,
                                         java.lang.Exception
find the modification made to the classlist. (adding, removing, timestamp...)


findNewClass

private void findNewClass()
                   throws java.lang.Exception

findNewClass

private void findNewClass(ch.epfl.lamp.smartanalysis.util.AbstractFile f,
                          java.lang.String path)
                   throws java.lang.Exception

sourceFileNotFound

protected abstract void sourceFileNotFound(DepClass dclass)
                                    throws java.lang.Exception
the source file for this class has been deleted.


sourceFileNotDefined

protected abstract void sourceFileNotDefined(DepClass dclass)
                                      throws java.lang.Exception
the source file for this class is not defined properly.


newClassFile

protected abstract void newClassFile(java.lang.String className)
                              throws java.lang.Exception
a new class has been found.


classFileDeleted

protected abstract void classFileDeleted(DepClass dclass,
                                         java.io.File classFile)
what should be done if a class file is deleted.


classFileModified

protected abstract void classFileModified(DepClass dclass,
                                          java.io.File classFile)
what should be done if a class file is modified.


sourceFileModified

protected abstract void sourceFileModified(DepClass dclass,
                                           java.io.File sourceFile)
what should be done if a source file is modified.


cache

protected void cache()
              throws java.io.FileNotFoundException,
                     java.io.IOException
write the dependency graph to disk.


cache

public void cache(java.io.File f)
specify the file where to cache this analyser.


writeClassList

public void writeClassList(java.io.File f)
                    throws java.io.IOException
write all definitions of the classes known by this project.


makeGraph

private void makeGraph()

findModifiedSource

protected void findModifiedSource()
find the sources that have been modified since last run.


done

public void done()
          throws java.io.FileNotFoundException,
                 java.io.IOException
we are done with this object.


finalize

protected void finalize()
                 throws java.lang.Throwable
Description copied from class: java.lang.Object
Called on an object by the Virtual Machine at most once, at some point after the Object is determined unreachable but before it is destroyed. You would think that this means it eventually is called on every Object, but this is not necessarily the case. If execution terminates abnormally, garbage collection does not always happen. Thus you cannot rely on this method to always work. For finer control over garbage collection, use references from the java.lang.ref package.

Virtual Machines are free to not call this method if they can determine that it does nothing important; for example, if your class extends Object and overrides finalize to do simply super.finalize().

finalize() will be called by a java.lang.Thread that has no locks on any Objects, and may be called concurrently. There are no guarantees on the order in which multiple objects are finalized. This means that finalize() is usually unsuited for performing actions that must be thread-safe, and that your implementation must be use defensive programming if it is to always work.

If an Exception is thrown from finalize() during garbage collection, it will be patently ignored and the Object will still be destroyed.

It is allowed, although not typical, for user code to call finalize() directly. User invocation does not affect whether automatic invocation will occur. It is also permitted, although not recommended, for a finalize() method to "revive" an object by making it reachable from normal code again.

Unlike constructors, finalize() does not get called for an object's superclass unless the implementation specifically calls super.finalize().

The default implementation does nothing.