@ThreadSafe public abstract class AbstractFileTypeAnalyzer extends AbstractAnalyzer implements FileTypeAnalyzer
Constructor and Description |
---|
AbstractFileTypeAnalyzer() |
Modifier and Type | Method and Description |
---|---|
boolean |
accept(java.io.File pathname)
Determines if the file can be analyzed by the analyzer.
|
protected abstract java.io.FileFilter |
getFileFilter()
Returns the
FileFilter used to determine which files are
to be analyzed. |
protected boolean |
getFilesMatched()
Gets the value of filesMatched.
|
protected static java.util.Set<java.lang.String> |
newHashSet(java.lang.String... strings)
Utility method to help in the creation of the extensions set.
|
protected void |
prepareAnalyzer(Engine engine)
Initializes the analyzer.
|
protected abstract void |
prepareFileTypeAnalyzer(Engine engine)
Prepares the file type analyzer for dependency analysis.
|
protected void |
setFilesMatched(boolean filesMatched)
Set the value of filesMatched.
|
analyze, analyzeDependency, close, closeAnalyzer, getAnalyzerEnabledSettingKey, getSettings, initialize, isEnabled, prepare, setEnabled, supportsParallelProcessing
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
analyze, close, getAnalysisPhase, getName, initialize, isEnabled, prepare, supportsParallelProcessing
protected void setFilesMatched(boolean filesMatched)
filesMatched
- new value of filesMatchedprotected boolean getFilesMatched()
protected final void prepareAnalyzer(Engine engine) throws InitializationException
prepareAnalyzer
in class AbstractAnalyzer
engine
- a reference to the dependency-check engineInitializationException
- thrown if there is an exception during
initializationprotected 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.
protected abstract void prepareFileTypeAnalyzer(Engine engine) throws InitializationException
engine
- a reference to the dependency-check engineInitializationException
- thrown if there is an exception during
initializationpublic boolean accept(java.io.File pathname)
accept
in interface java.io.FileFilter
pathname
- the path to the fileprotected 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
strings
- a list of strings to add to the set.Copyright© 2012-21 Jeremy Long. All Rights Reserved.