All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.osgl.inject.ElementLoader Maven / Gradle / Ivy

There is a newer version: 1.13.2
Show newest version
package org.osgl.inject;

import java.util.Collection;
import java.util.Map;

/**
 * An `ElementLoader` is responsible for providing initial data
 * to be loaded into a {@link Collection} type
 *
 * @param  the generic element type
 */
public interface ElementLoader extends ElementFilter {

    /**
     * Provide element data to be loaded
     *
     * @param options   options that could be used to regulate the data loading logic
     * @param container the bean spec about the container into which the element will be loaded
     * @param genie     the dependency injector that could be used to recursively load dependencies
     * @return an {@link Iterable} of elements
     */
    Iterable load(Map options, BeanSpec container, Genie genie);

    /**
     * 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 {@link 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. * * @return priority of the loader */ int priority(); }





© 2015 - 2025 Weber Informatics LLC | Privacy Policy