Class AbstractFileTypeAnalyzer

    • Constructor Detail

      • AbstractFileTypeAnalyzer

        public AbstractFileTypeAnalyzer()
    • Method Detail

      • setFilesMatched

        protected void setFilesMatched​(boolean filesMatched)
        Set the value of filesMatched. A flag indicating whether the scan included any file types this analyzer supports.
        Parameters:
        filesMatched - new value of filesMatched
      • getFilesMatched

        protected boolean getFilesMatched()
        Gets the value of filesMatched. A flag indicating whether the scan included any file types this analyzer supports.
        Returns:
        the value of filesMatched
      • getFileFilter

        protected abstract java.io.FileFilter getFileFilter()

        Returns the FileFilter used to determine which files are to be analyzed. An example would be an analyzer that inspected Java jar files. Implementors may use FileFilterBuilder.

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

        Returns:
        the file filter used to determine which files are to be analyzed
      • prepareFileTypeAnalyzer

        protected abstract void prepareFileTypeAnalyzer​(Engine engine)
                                                 throws InitializationException
        Prepares the file type analyzer for dependency analysis.
        Parameters:
        engine - a reference to the dependency-check engine
        Throws:
        InitializationException - thrown if there is an exception during initialization
      • accept

        public boolean accept​(java.io.File pathname)
        Determines if the file can be analyzed by the analyzer.
        Specified by:
        accept in interface java.io.FileFilter
        Parameters:
        pathname - the path to the file
        Returns:
        true if the file can be analyzed by the given analyzer; otherwise false
      • newHashSet

        protected static java.util.Set<java.lang.String> newHashSet​(java.lang.String... strings)

        Utility method to help in the creation of the extensions set. This constructs a new Set that can be used in a final static declaration.

        This implementation was copied from http://stackoverflow.com/questions/2041778/prepare-java-hashset-values-by-construction

        Parameters:
        strings - a list of strings to add to the set.
        Returns:
        a Set of strings.