public abstract class ZipArchiveAnalyzer<F extends BaseElementForest<E>,E extends BaseElement<E>> extends BaseEagerLoadingArchiveAnalyzer<F,E>
This implementation is only useful for API analyzers that process the files in the ZIP archives one-by-one in some manner. E.g. they might be looking for some concrete files in the zip or can compose the API from looking at the individual files. For analyzers that need to process the files as a whole, this might not be the ideal superclass to inherit from.
This implementation ignores the supplementary archives
of the API.
BaseEagerLoadingArchiveAnalyzer.FullForestContext
Modifier and Type | Field and Description |
---|---|
protected List<Pattern> |
matchPatterns |
Constructor and Description |
---|
ZipArchiveAnalyzer(ApiAnalyzer<E> apiAnalyzer,
API api,
List<Pattern> matchPatterns) |
Modifier and Type | Method and Description |
---|---|
protected Set<E> |
createElements(Archive archive)
Scans the archive and returns the elements within.
|
protected abstract Set<E> |
createElements(Archive a,
ZipEntry entry,
InputStream data)
Creates elements out of the provided data.
|
discoverElements, discoverRoots, preAnalyze
addTo, analyze, getApi, getApiAnalyzer, newElementForest, postAnalyze, prune
public ZipArchiveAnalyzer(ApiAnalyzer<E> apiAnalyzer, API api, List<Pattern> matchPatterns)
apiAnalyzer
- the api analyzer for which this archive analyzer is createdapi
- the API this analyzer analyzesmatchPatterns
- the match patterns for files looked for in the zip fileprotected Set<E> createElements(Archive archive)
BaseEagerLoadingArchiveAnalyzer
createElements
in class BaseEagerLoadingArchiveAnalyzer<F extends BaseElementForest<E>,E extends BaseElement<E>>
archive
- the archive to analyzeprotected abstract Set<E> createElements(Archive a, @Nullable ZipEntry entry, InputStream data) throws IOException
ZipArchiveAnalyzer
base implementation. If the returned elements
contain any sub-elements, they need to be added as children though.a
- the archive containing the entryentry
- the zip file entry, can be null if parsing data of the whole file (in case it is not a ZIP file)data
- the data of the entryIOException
Copyright © 2014-2021 Lukas Krejci. All Rights Reserved.