Package net.sourceforge.pmd.cache
Interface AnalysisCache
-
- All Superinterfaces:
ThreadSafeReportListener
- All Known Implementing Classes:
AbstractAnalysisCache
,FileAnalysisCache
,NoopAnalysisCache
public interface AnalysisCache extends ThreadSafeReportListener
An analysis cache for incremental analysis.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description void
analysisFailed(java.io.File sourceFile)
Notifies the cache that analysis of the given file has failed and should not be cachedvoid
checkValidity(RuleSets ruleSets, java.lang.ClassLoader auxclassPathClassLoader)
Checks if the cache is valid for the configured rulesets and class loader.java.util.List<RuleViolation>
getCachedViolations(java.io.File sourceFile)
Retrieves cached violations for the given file.boolean
isUpToDate(java.io.File sourceFile)
Check if a given file is up to date in the cache and can be skipped from analysisvoid
persist()
Persist the analysis results on whatever means is used by the cache-
Methods inherited from interface net.sourceforge.pmd.ThreadSafeReportListener
metricAdded, ruleViolationAdded
-
-
-
-
Method Detail
-
persist
void persist()
Persist the analysis results on whatever means is used by the cache
-
isUpToDate
boolean isUpToDate(java.io.File sourceFile)
Check if a given file is up to date in the cache and can be skipped from analysis- Parameters:
sourceFile
- The file to check in the cache- Returns:
- True if the cache is a hit, false otherwise
-
getCachedViolations
java.util.List<RuleViolation> getCachedViolations(java.io.File sourceFile)
Retrieves cached violations for the given file. Make sure to callisUpToDate(File)
first.- Parameters:
sourceFile
- The file to check in the cache- Returns:
- The list of cached violations.
-
analysisFailed
void analysisFailed(java.io.File sourceFile)
Notifies the cache that analysis of the given file has failed and should not be cached- Parameters:
sourceFile
- The file whose analysis failed
-
checkValidity
void checkValidity(RuleSets ruleSets, java.lang.ClassLoader auxclassPathClassLoader)
Checks if the cache is valid for the configured rulesets and class loader.- Parameters:
ruleSets
- The rulesets configured for this analysis.auxclassPathClassLoader
- The class loader for auxclasspath configured for this analysis.
-
-