Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## org.owasp.dependencycheck.analyzer
Interface Analyzer

All Known Implementing Classes:
  AbstractAnalyzer, ArchiveAnalyzer, CPEAnalyzer, DependencyBundlingAnalyzer, FalsePositiveAnalyzer, FileNameAnalyzer, HintAnalyzer, JarAnalyzer, JavaScriptAnalyzer, NvdCveAnalyzer

    public interface Analyzer

An interface that defines an Analyzer that is used to identify Dependencies. An analyzer will collect information about the dependency in the form of Evidence.

Author:
  Jeremy Long (jeremy.long@owasp.org)

Method Summary
`void` | `analyze(Dependency dependency, Engine engine)` Analyzes the given dependency.
`void` | `close()` The close method is called after all of the dependencies have been analyzed.
`AnalysisPhase` | `getAnalysisPhase()` Returns the phase that the analyzer is intended to run in.
`String` | `getName()` Returns the name of the analyzer.
`Set<String>` | `getSupportedExtensions()` Returns a list of supported file extensions.
`void` | `initialize()` The initialize method is called (once) prior to the analyze method being called on all of the dependencies.
`boolean` | `supportsExtension(String extension)` Returns whether or not this analyzer can process the given extension.

Method Detail

### analyze

    void analyze(Dependency dependency,
                 Engine engine)
                 throws AnalysisException

  Analyzes the given dependency. The analysis could be anything from identifying an Identifier for the dependency, to finding vulnerabilities, etc. Additionally, if the analyzer collects enough information to add a description or license information for the dependency it should be added.

  Parameters:
    `dependency` - a dependency to analyze.
    `engine` - the engine that is scanning the dependencies - this is useful if we need to check other dependencies
  Throws:
    `AnalysisException` - is thrown if there is an error analyzing the dependency file

### getSupportedExtensions

    Set<String> getSupportedExtensions()

  Returns a list of supported file extensions. An example would be an analyzer that inspected java jar files. The getSupportedExtensions function would return a set with a single element "jar".

  Note: when implementing this the extensions returned MUST be lowercase.

  Returns:
    The file extensions supported by this analyzer.

    If the analyzer returns null it will not cause additional files to be analyzed but will be executed against every file loaded

### getName

    String getName()

  Returns the name of the analyzer.

  Returns:
    the name of the analyzer.

### supportsExtension

    boolean supportsExtension(String extension)

  Returns whether or not this analyzer can process the given extension.

  Parameters:
    `extension` - the file extension to test for support.
  Returns:
    whether or not the specified file extension is supported by this analyzer.

### getAnalysisPhase

    AnalysisPhase getAnalysisPhase()

  Returns the phase that the analyzer is intended to run in.

  Returns:
    the phase that the analyzer is intended to run in.

### initialize

    void initialize()
                    throws Exception

  The initialize method is called (once) prior to the analyze method being called on all of the dependencies.

  Throws:
    `Exception` - is thrown if an exception occurs initializing the analyzer.

### close

    void close()
               throws Exception

  The close method is called after all of the dependencies have been analyzed.

  Throws:
    `Exception` - is thrown if an exception occurs closing the analyzer.

Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

Copyright © 2012-2013 OWASP. All Rights Reserved.