E
- the parent type of all elements produced by the API analyzerpublic abstract class BaseEagerLoadingArchiveAnalyzer<F extends BaseElementForest<E>,E extends BaseElement<E>> extends BaseArchiveAnalyzer<F,E>
Modifier and Type | Class and Description |
---|---|
protected class |
BaseEagerLoadingArchiveAnalyzer.FullForestContext
This context object is used to "remember" all the elements that were created during parsing of an archive.
|
Constructor and Description |
---|
BaseEagerLoadingArchiveAnalyzer(ApiAnalyzer<E> apiAnalyzer,
API api,
boolean processSupplementaryArchives) |
Modifier and Type | Method and Description |
---|---|
protected abstract Set<E> |
createElements(Archive archive)
Scans the archive and returns the elements within.
|
protected java.util.stream.Stream<E> |
discoverElements(Object context,
E parent)
Discovers new elements under the given parent element.
|
protected java.util.stream.Stream<E> |
discoverRoots(Object context)
Discovers all the root elements in the relevant archives of the API.
|
protected BaseEagerLoadingArchiveAnalyzer.FullForestContext |
preAnalyze()
Called as the first thing in
BaseArchiveAnalyzer.analyze(TreeFilter) . |
addTo, analyze, getApi, getApiAnalyzer, newElementForest, postAnalyze, prune
public BaseEagerLoadingArchiveAnalyzer(ApiAnalyzer<E> apiAnalyzer, API api, boolean processSupplementaryArchives)
protected BaseEagerLoadingArchiveAnalyzer.FullForestContext preAnalyze()
BaseArchiveAnalyzer.analyze(TreeFilter)
. Can be used by the subclasses to initialize themselves
for the analysis.
This implementation eagerly analyzes all the archives and remembers the results so that the final tree can
be computed.preAnalyze
in class BaseArchiveAnalyzer<F extends BaseElementForest<E>,E extends BaseElement<E>>
BaseArchiveAnalyzer.postAnalyze(Object)
protected java.util.stream.Stream<E> discoverRoots(Object context)
BaseArchiveAnalyzer.preAnalyze()
and before all BaseArchiveAnalyzer.discoverElements(Object, BaseElement)
calls.
This method assumes the context is a BaseEagerLoadingArchiveAnalyzer.FullForestContext
and uses it to return the recorded roots.
discoverRoots
in class BaseArchiveAnalyzer<F extends BaseElementForest<E>,E extends BaseElement<E>>
context
- the full forest contextprotected java.util.stream.Stream<E> discoverElements(Object context, E parent)
This method assumes the context is a BaseEagerLoadingArchiveAnalyzer.FullForestContext
and uses it to return the recorded children
of the provided element.
discoverElements
in class BaseArchiveAnalyzer<F extends BaseElementForest<E>,E extends BaseElement<E>>
context
- the full forest contextparent
- the parent to discover children ofprotected abstract Set<E> createElements(Archive archive)
archive
- the archive to analyzeCopyright © 2014-2021 Lukas Krejci. All Rights Reserved.