E - the generic element typepublic interface ElementLoader<E> extends ElementFilter<E>
An ElementLoader is responsible for providing initial data to be loaded into a Collection type.
| Modifier and Type | Method and Description |
|---|---|
Iterable<E> |
load(Map<String,Object> options,
BeanSpec container,
Genie genie)
Provide element data to be loaded.
|
int |
priority()
When multiple
ElementLoader are used together to load initial data, the priority() method can used to determine which loader is called first. |
filterIterable<E> load(Map<String,Object> options, BeanSpec container, Genie genie)
Provide element data to be loaded.
options - options that could be used to regulate the data loading logiccontainer - the bean spec about the container into which the element will be loadedgenie - the dependency injector that could be used to recursively load dependenciesIterable of elementsint priority()
When multiple ElementLoader are used together to load initial data, the priority() method can used to determine which loader is called first. All following loaders will be treated as ElementFilter to filter the data series generated by the first loader.
A good practice is if a loader loads fewer number of instance, then the priority value shall be lower than that of the loader which loads more instances.
Copyright © 2016–2018 OSGL (Open Source General Library). All rights reserved.