Class AbstractAnalyzer

    • Constructor Detail

      • AbstractAnalyzer

        public AbstractAnalyzer()
    • Method Detail

      • isEnabled

        public boolean isEnabled()
        Get the value of enabled.
        Specified by:
        isEnabled in interface Analyzer
        Returns:
        the value of enabled
      • setEnabled

        public void setEnabled​(boolean enabled)
        Set the value of enabled.
        Parameters:
        enabled - new value of enabled
      • getSettings

        protected Settings getSettings()
        Returns the configured settings.
        Returns:
        the configured settings
      • initialize

        public void initialize​(Settings settings)
        Initializes the analyzer with the configured settings.
        Specified by:
        initialize in interface Analyzer
        Parameters:
        settings - the configured settings to use
      • prepareAnalyzer

        protected void prepareAnalyzer​(Engine engine)
                                throws InitializationException
        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

        public final void analyze​(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.
        Specified by:
        analyze in interface Analyzer
        Parameters:
        dependency - the dependency to analyze
        engine - 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 analyze
        engine - the engine scanning
        Throws:
        AnalysisException - thrown if there is an analysis exception
      • close

        public final void close()
                         throws java.lang.Exception
        The close method does nothing for this Analyzer.
        Specified by:
        close in interface Analyzer
        Throws:
        java.lang.Exception - thrown if there is an exception
      • closeAnalyzer

        protected void closeAnalyzer()
                              throws java.lang.Exception
        Closes a given Analyzer. This will be skipped if the analyzer is disabled.
        Throws:
        java.lang.Exception - thrown if there is an exception
      • supportsParallelProcessing

        public boolean supportsParallelProcessing()
        The default is to support parallel processing.
        Specified by:
        supportsParallelProcessing in interface Analyzer
        Returns:
        true
      • getAnalyzerEnabledSettingKey

        protected abstract java.lang.String getAnalyzerEnabledSettingKey()

        Returns the setting key to determine if the analyzer is enabled.

        Returns:
        the key for the analyzer's enabled property