Class AbstractSuppressionAnalyzer
- java.lang.Object
-
- org.owasp.dependencycheck.analyzer.AbstractAnalyzer
-
- org.owasp.dependencycheck.analyzer.AbstractSuppressionAnalyzer
-
- All Implemented Interfaces:
Analyzer
- Direct Known Subclasses:
CpeSuppressionAnalyzer,VulnerabilitySuppressionAnalyzer
@ThreadSafe public abstract class AbstractSuppressionAnalyzer extends AbstractAnalyzer
Abstract base suppression analyzer that contains methods for parsing the suppression XML file.- Author:
- Jeremy Long
-
-
Field Summary
Fields Modifier and Type Field Description static java.lang.StringSUPPRESSION_OBJECT_KEYThe key used to store and retrieve the suppression files.
-
Constructor Summary
Constructors Constructor Description AbstractSuppressionAnalyzer()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description protected voidanalyzeDependency(Dependency dependency, Engine engine)Analyzes a given dependency.static intgetRuleCount(Engine engine)Returns the number of suppression rules currently loaded in the engine.java.util.Set<java.lang.String>getSupportedExtensions()Returns a list of file EXTENSIONS supported by this analyzer.voidprepareAnalyzer(Engine engine)The prepare method loads the suppression XML file.-
Methods inherited from class org.owasp.dependencycheck.analyzer.AbstractAnalyzer
analyze, close, closeAnalyzer, getAnalyzerEnabledSettingKey, getSettings, initialize, isEnabled, prepare, setEnabled, supportsParallelProcessing
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.owasp.dependencycheck.analyzer.Analyzer
getAnalysisPhase, getName
-
-
-
-
Field Detail
-
SUPPRESSION_OBJECT_KEY
public static final java.lang.String SUPPRESSION_OBJECT_KEY
The key used to store and retrieve the suppression files.- See Also:
- Constant Field Values
-
-
Method Detail
-
getSupportedExtensions
public java.util.Set<java.lang.String> getSupportedExtensions()
Returns a list of file EXTENSIONS supported by this analyzer.- Returns:
- a list of file EXTENSIONS supported by this analyzer.
-
prepareAnalyzer
public void prepareAnalyzer(Engine engine) throws InitializationException
The prepare method loads the suppression XML file.- Overrides:
prepareAnalyzerin classAbstractAnalyzer- Parameters:
engine- a reference the dependency-check engine- Throws:
InitializationException- thrown if there is an exception
-
analyzeDependency
protected void analyzeDependency(Dependency dependency, Engine engine) throws AnalysisException
Description copied from class:AbstractAnalyzerAnalyzes 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:
analyzeDependencyin classAbstractAnalyzer- Parameters:
dependency- the dependency to analyzeengine- the engine scanning- Throws:
AnalysisException- thrown if there is an analysis exception
-
getRuleCount
public static int getRuleCount(Engine engine)
Returns the number of suppression rules currently loaded in the engine.- Parameters:
engine- a reference to the ODC engine- Returns:
- the count of rules loaded
-
-