edu.umd.cs.findbugs.ba
Class ClassContext.AnalysisFactory<Analysis>

java.lang.Object
  extended by edu.umd.cs.findbugs.ba.ClassContext.AnalysisFactory<Analysis>
Direct Known Subclasses:
ClassContext.CFGFactory, ClassContext.NoDataflowAnalysisFactory, ClassContext.NoExceptionAnalysisFactory
Enclosing class:
ClassContext

private abstract class ClassContext.AnalysisFactory<Analysis>
extends java.lang.Object

Abstract factory class for creating analysis objects. Handles caching of analysis results for a method.


Field Summary
private  java.lang.String analysisName
           
private  java.util.HashMap<org.apache.bcel.classfile.Method,ClassContext.AnalysisResult<Analysis>> map
           
 
Constructor Summary
ClassContext.AnalysisFactory(java.lang.String analysisName)
          Constructor.
 
Method Summary
protected abstract  Analysis analyze(org.apache.bcel.classfile.Method method)
           
 Analysis getAnalysis(org.apache.bcel.classfile.Method method)
          Get the Analysis for given method.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

analysisName

private java.lang.String analysisName

map

private java.util.HashMap<org.apache.bcel.classfile.Method,ClassContext.AnalysisResult<Analysis>> map
Constructor Detail

ClassContext.AnalysisFactory

public ClassContext.AnalysisFactory(java.lang.String analysisName)
Constructor.

Parameters:
analysisName - name of the analysis factory: for diagnostics/debugging
Method Detail

getAnalysis

public Analysis getAnalysis(org.apache.bcel.classfile.Method method)
                     throws CFGBuilderException,
                            DataflowAnalysisException
Get the Analysis for given method. If Analysis has already been performed, the cached result is returned.

Parameters:
method - the method to analyze
Returns:
the Analysis object representing the result of analyzing the method
Throws:
CFGBuilderException - if the CFG can't be constructed for the method
DataflowAnalysisException - if dataflow analysis fails on the method

analyze

protected abstract Analysis analyze(org.apache.bcel.classfile.Method method)
                             throws CFGBuilderException,
                                    DataflowAnalysisException
Throws:
CFGBuilderException
DataflowAnalysisException