public class AnalysisCache extends java.lang.Object implements IAnalysisCache
Modifier and Type | Method and Description |
---|---|
void |
dispose()
Cleans up all cached data
|
<E> void |
eagerlyPutDatabase(java.lang.Class<E> databaseClass,
E database)
Eagerly install a database.
|
<E> void |
eagerlyPutMethodAnalysis(java.lang.Class<E> analysisClass,
MethodDescriptor methodDescriptor,
E analysisObject)
Eagerly put a method analysis object in the cache.
|
java.util.Map<?,?> |
getAnalysisLocals()
Get map of analysis-local objects.
|
java.util.Map<ClassDescriptor,java.lang.Object> |
getClassAnalysis(java.lang.Class<?> analysisClass) |
<E> E |
getClassAnalysis(java.lang.Class<E> analysisClass,
ClassDescriptor classDescriptor)
Get an analysis of the given class.
|
IClassPath |
getClassPath()
Get the classpath from which classes are loaded.
|
<E> E |
getDatabase(java.lang.Class<E> databaseClass)
Get a database.
|
<E> E |
getDatabase(java.lang.Class<E> databaseClass,
boolean optional) |
IErrorLogger |
getErrorLogger()
Get the error logger.
|
<E> E |
getMethodAnalysis(java.lang.Class<E> analysisClass,
MethodDescriptor methodDescriptor)
Get an analysis of the given method.
|
<E> E |
getOptionalDatabase(java.lang.Class<E> databaseClass) |
Profiler |
getProfiler()
Get the analysis profiler instance, never null
|
<E> E |
probeClassAnalysis(java.lang.Class<E> analysisClass,
ClassDescriptor classDescriptor)
See if the cache contains a cached class analysis result for given class
descriptor.
|
void |
purgeAllMethodAnalysis()
Purge all method analysis results for all methods.
|
void |
purgeClassAnalysis(java.lang.Class<?> analysisClass)
Purge all class analysis results of a particular kind
|
void |
purgeMethodAnalyses(MethodDescriptor methodDescriptor)
Purge all analysis results for given method.
|
<E> void |
registerClassAnalysisEngine(java.lang.Class<E> analysisResultType,
IClassAnalysisEngine<E> classAnalysisEngine)
Register the given class analysis engine as producing the analysis result
type whose Class is given.
|
<E> void |
registerDatabaseFactory(java.lang.Class<E> databaseClass,
IDatabaseFactory<E> databaseFactory)
Register a database factory.
|
<E> void |
registerMethodAnalysisEngine(java.lang.Class<E> analysisResultType,
IMethodAnalysisEngine<E> methodAnalysisEngine)
Register the given method analysis engine as producing the analysis
result type whose Class is given.
|
<E> void |
reuseClassAnalysis(java.lang.Class<E> analysisClass,
java.util.Map<ClassDescriptor,java.lang.Object> map)
Adds the data for given analysis type from given map to the cache
|
public final java.util.Map<?,?> getAnalysisLocals()
IAnalysisCache
getAnalysisLocals
in interface IAnalysisCache
public IClassPath getClassPath()
IAnalysisCache
getClassPath
in interface IAnalysisCache
public void purgeAllMethodAnalysis()
IAnalysisCache
purgeAllMethodAnalysis
in interface IAnalysisCache
public void purgeClassAnalysis(java.lang.Class<?> analysisClass)
IAnalysisCache
purgeClassAnalysis
in interface IAnalysisCache
public void dispose()
@CheckForNull public java.util.Map<ClassDescriptor,java.lang.Object> getClassAnalysis(java.lang.Class<?> analysisClass)
analysisClass
- non null analysis typepublic <E> void reuseClassAnalysis(java.lang.Class<E> analysisClass, java.util.Map<ClassDescriptor,java.lang.Object> map)
analysisClass
- non null analysis typemap
- non null, pre-filled map with analysis data for given typepublic <E> E getClassAnalysis(java.lang.Class<E> analysisClass, @Nonnull ClassDescriptor classDescriptor) throws CheckedAnalysisException
IAnalysisCache
getClassAnalysis
in interface IAnalysisCache
E
- the type of the analysis (e.g., FoobarAnalysis)analysisClass
- the analysis class object (e.g., FoobarAnalysis.class)classDescriptor
- the descriptor of the class to analyzeCheckedAnalysisException
- if an error occurs performing the analysispublic <E> E probeClassAnalysis(java.lang.Class<E> analysisClass, @Nonnull ClassDescriptor classDescriptor)
IAnalysisCache
probeClassAnalysis
in interface IAnalysisCache
analysisClass
- analysis result classclassDescriptor
- the class descriptorpublic <E> E getMethodAnalysis(java.lang.Class<E> analysisClass, @Nonnull MethodDescriptor methodDescriptor) throws CheckedAnalysisException
IAnalysisCache
getMethodAnalysis
in interface IAnalysisCache
E
- the type of the analysis (e.g., FoobarAnalysis)analysisClass
- the analysis class object (e.g., FoobarAnalysis.class)methodDescriptor
- the descriptor of the method to analyzeCheckedAnalysisException
- if an error occurs performing the analysispublic <E> void eagerlyPutMethodAnalysis(java.lang.Class<E> analysisClass, @Nonnull MethodDescriptor methodDescriptor, E analysisObject)
IAnalysisCache
eagerlyPutMethodAnalysis
in interface IAnalysisCache
E
- the type of the analysis (e.g., FoobarAnalysis)analysisClass
- the analysis class object (e.g., FoobarAnalysis.class)methodDescriptor
- the descriptor of the method to analyzepublic void purgeMethodAnalyses(@Nonnull MethodDescriptor methodDescriptor)
IAnalysisCache
purgeMethodAnalyses
in interface IAnalysisCache
methodDescriptor
- method whose analysis results should be purgedpublic <E> void registerClassAnalysisEngine(java.lang.Class<E> analysisResultType, IClassAnalysisEngine<E> classAnalysisEngine)
IAnalysisCache
registerClassAnalysisEngine
in interface IAnalysisCache
E
- analysis result typeanalysisResultType
- analysis result type Class objectclassAnalysisEngine
- the class analysis engine to registerpublic <E> void registerMethodAnalysisEngine(java.lang.Class<E> analysisResultType, IMethodAnalysisEngine<E> methodAnalysisEngine)
IAnalysisCache
registerMethodAnalysisEngine
in interface IAnalysisCache
E
- analysis result typeanalysisResultType
- analysis result type Class objectmethodAnalysisEngine
- the method analysis engine to registerpublic <E> void registerDatabaseFactory(java.lang.Class<E> databaseClass, IDatabaseFactory<E> databaseFactory)
IAnalysisCache
registerDatabaseFactory
in interface IAnalysisCache
E
- type of databasedatabaseClass
- Class of databasedatabaseFactory
- the database factorypublic <E> E getDatabase(java.lang.Class<E> databaseClass)
IAnalysisCache
getDatabase
in interface IAnalysisCache
E
- type of databasedatabaseClass
- Class of database@CheckForNull public <E> E getOptionalDatabase(java.lang.Class<E> databaseClass)
getOptionalDatabase
in interface IAnalysisCache
public <E> E getDatabase(java.lang.Class<E> databaseClass, boolean optional)
public <E> void eagerlyPutDatabase(java.lang.Class<E> databaseClass, E database)
IAnalysisCache
eagerlyPutDatabase
in interface IAnalysisCache
E
- type of databasedatabaseClass
- Class of databasedatabase
- database objectpublic IErrorLogger getErrorLogger()
IAnalysisCache
getErrorLogger
in interface IAnalysisCache
public Profiler getProfiler()
IAnalysisCache
getProfiler
in interface IAnalysisCache
FindBugs™ is licenced under the LGPL. Copyright © 2006 University of Maryland.