edu.cmu.cs.crystal
Class AbstractCompilationUnitAnalysis

java.lang.Object
  extended by edu.cmu.cs.crystal.AbstractCompilationUnitAnalysis
All Implemented Interfaces:
ICrystalAnalysis

public abstract class AbstractCompilationUnitAnalysis
extends Object
implements ICrystalAnalysis

An ICrystal analysis which analyses each compilation unit as a whole.

Author:
David Dickey

Constructor Summary
AbstractCompilationUnitAnalysis()
           
 
Method Summary
 void afterAllCompilationUnits()
          Inform the analysis that all compilation units have been analyzed.
abstract  void analyzeCompilationUnit(CompilationUnit d)
          Invoked once for each compilation unit.
 void beforeAllCompilationUnits()
          Inform the analysis that the analysis process is about to begin.
 IAnalysisInput getInput()
           
 String getName()
           
 IAnalysisReporter getReporter()
           
 void runAnalysis(IAnalysisReporter reporter, IAnalysisInput input, ITypeRoot compUnit, CompilationUnit rootNode)
          This implementation of runAnalysis will set the reporter and input and then call the abstract method $analyzeCompilationUnit.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AbstractCompilationUnitAnalysis

public AbstractCompilationUnitAnalysis()
Method Detail

getName

public String getName()
Specified by:
getName in interface ICrystalAnalysis
Returns:
a unique name for this analysis. This name will be used by Crystal for menu items, error reporting, and otherwise identifying this analysis to the user.

runAnalysis

public void runAnalysis(IAnalysisReporter reporter,
                        IAnalysisInput input,
                        ITypeRoot compUnit,
                        CompilationUnit rootNode)
This implementation of runAnalysis will set the reporter and input and then call the abstract method $analyzeCompilationUnit.

Specified by:
runAnalysis in interface ICrystalAnalysis
Parameters:
compUnit - The ITypeRoot that represents the .java or .class file we are analyzing
reporter - The IAnalysisReport that allows an analysis to report issues.
rootNode - The ASTNode which represents this compilation unit.
input - The input to this analysis.

afterAllCompilationUnits

public void afterAllCompilationUnits()
Description copied from interface: ICrystalAnalysis
Inform the analysis that all compilation units have been analyzed.

Specified by:
afterAllCompilationUnits in interface ICrystalAnalysis

beforeAllCompilationUnits

public void beforeAllCompilationUnits()
Description copied from interface: ICrystalAnalysis
Inform the analysis that the analysis process is about to begin.

Specified by:
beforeAllCompilationUnits in interface ICrystalAnalysis

getReporter

public IAnalysisReporter getReporter()
Specified by:
getReporter in interface ICrystalAnalysis
Returns:
the IAnalysisReporter that is being used for the current run of the analysis, or null if there is not currently an analysis being run.

getInput

public IAnalysisInput getInput()
Specified by:
getInput in interface ICrystalAnalysis
Returns:
the IAnalysisInput that is being used for the current run of the analysis, or null if there is not currently an analysis being run.

analyzeCompilationUnit

public abstract void analyzeCompilationUnit(CompilationUnit d)
Invoked once for each compilation unit.