public abstract class AbstractAnalysisCache extends Object implements AnalysisCache
| Modifier and Type | Field and Description |
|---|---|
protected long |
classpathChecksum |
protected ConcurrentMap<String,AnalysisResult> |
fileResultsCache |
protected static Logger |
LOG |
protected String |
pmdVersion |
protected CachedRuleMapper |
ruleMapper |
protected long |
rulesetChecksum |
protected ConcurrentMap<String,AnalysisResult> |
updatedResultsCache |
| Constructor and Description |
|---|
AbstractAnalysisCache()
Creates a new empty cache
|
| Modifier and Type | Method and Description |
|---|---|
void |
analysisFailed(File sourceFile)
Notifies the cache that analysis of the given file has failed and should not be cached
|
void |
checkValidity(RuleSets ruleSets,
ClassLoader classLoader)
Checks if the cache is valid for the configured rulesets and class loader.
|
List<RuleViolation> |
getCachedViolations(File sourceFile)
Retrieves cached violations for the given file.
|
boolean |
isUpToDate(File sourceFile)
Check if a given file is up to date in the cache and can be skipped from analysis
|
void |
metricAdded(Metric metric)
A new metric point has been reported.
|
void |
ruleViolationAdded(RuleViolation ruleViolation)
A new violation has been found.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitpersistprotected static final Logger LOG
protected final String pmdVersion
protected final ConcurrentMap<String,AnalysisResult> fileResultsCache
protected final ConcurrentMap<String,AnalysisResult> updatedResultsCache
protected long rulesetChecksum
protected long classpathChecksum
protected final CachedRuleMapper ruleMapper
public boolean isUpToDate(File sourceFile)
AnalysisCacheisUpToDate in interface AnalysisCachesourceFile - The file to check in the cachepublic List<RuleViolation> getCachedViolations(File sourceFile)
AnalysisCacheAnalysisCache.isUpToDate(File) first.getCachedViolations in interface AnalysisCachesourceFile - The file to check in the cachepublic void analysisFailed(File sourceFile)
AnalysisCacheanalysisFailed in interface AnalysisCachesourceFile - The file whose analysis failedpublic void checkValidity(RuleSets ruleSets, ClassLoader classLoader)
AnalysisCachecheckValidity in interface AnalysisCacheruleSets - The rulesets configured for this analysis.classLoader - The class loader configured for this analysis.public void ruleViolationAdded(RuleViolation ruleViolation)
ThreadSafeReportListenerruleViolationAdded in interface ReportListenerruleViolationAdded in interface ThreadSafeReportListenerruleViolation - the found violation.public void metricAdded(Metric metric)
ThreadSafeReportListenermetricAdded in interface ReportListenermetricAdded in interface ThreadSafeReportListenermetric - the metricCopyright © 2002–2017 PMD. All rights reserved.