Class AbstractAnalyzer
java.lang.Object
org.owasp.dependencycheck.analyzer.AbstractAnalyzer
- All Implemented Interfaces:
Analyzer
- Direct Known Subclasses:
AbstractDependencyComparingAnalyzer, AbstractFileTypeAnalyzer, AbstractSuppressionAnalyzer, CPEAnalyzer, FalsePositiveAnalyzer, FileNameAnalyzer, HintAnalyzer, KnownExploitedVulnerabilityAnalyzer, NvdCveAnalyzer, OssIndexAnalyzer, UnusedSuppressionRuleAnalyzer
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionfinal voidanalyze(Dependency dependency, Engine engine) Analyzes a given dependency.protected abstract voidanalyzeDependency(Dependency dependency, Engine engine) Analyzes a given dependency.final voidclose()The close method does nothing for this Analyzer.protected voidCloses a given Analyzer.protected abstract StringReturns the setting key to determine if the analyzer is enabled.protected SettingsReturns the configured settings.voidinitialize(Settings settings) Initializes the analyzer with the configured settings.booleanGet the value of enabled.final voidInitialize the abstract analyzer.protected voidprepareAnalyzer(Engine engine) Prepares a given Analyzer.voidsetEnabled(boolean enabled) Set the value of enabled.booleanThe default is to support parallel processing.Methods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface Analyzer
getAnalysisPhase, getName
-
Constructor Details
-
AbstractAnalyzer
public AbstractAnalyzer()
-
-
Method Details
-
isEnabled
-
setEnabled
public void setEnabled(boolean enabled) Set the value of enabled.- Parameters:
enabled- new value of enabled
-
getSettings
-
initialize
Initializes the analyzer with the configured settings.- Specified by:
initializein interfaceAnalyzer- Parameters:
settings- the configured settings to use
-
prepare
Initialize the abstract analyzer.- Specified by:
preparein interfaceAnalyzer- Parameters:
engine- a reference to the dependency-check engine- Throws:
InitializationException- thrown if there is an exception
-
prepareAnalyzer
Prepares a given Analyzer. This will be skipped if the analyzer is disabled.- Parameters:
engine- a reference to the dependency-check engine- Throws:
InitializationException- thrown if there is an exception
-
analyze
Analyzes a given dependency. If the dependency is an archive, such as a WAR or EAR, the contents are extracted, scanned, and added to the list of dependencies within the engine.- Specified by:
analyzein interfaceAnalyzer- Parameters:
dependency- the dependency to analyzeengine- the engine scanning- Throws:
AnalysisException- thrown if there is an analysis exception
-
analyzeDependency
protected abstract void analyzeDependency(Dependency dependency, Engine engine) throws AnalysisException Analyzes a given dependency. If the dependency is an archive, such as a WAR or EAR, the contents are extracted, scanned, and added to the list of dependencies within the engine.- Parameters:
dependency- the dependency to analyzeengine- the engine scanning- Throws:
AnalysisException- thrown if there is an analysis exception
-
close
-
closeAnalyzer
-
supportsParallelProcessing
public boolean supportsParallelProcessing()The default is to support parallel processing.- Specified by:
supportsParallelProcessingin interfaceAnalyzer- Returns:
- true
-
getAnalyzerEnabledSettingKey
Returns the setting key to determine if the analyzer is enabled.
- Returns:
- the key for the analyzer's enabled property
-