public abstract class TypedElementLoader<T> extends ElementLoaderBase<T>
Load beans whose class extends/implements specified class/interface (as hint)
| Constructor and Description |
|---|
TypedElementLoader() |
| Modifier and Type | Method and Description |
|---|---|
org.osgl.Osgl.Function<T,Boolean> |
filter(Map<String,Object> options,
BeanSpec container)
This method returns a predicate function that test the bean instance against the class specified by
hint. |
protected abstract List<Class<? extends T>> |
load(Class<T> type,
boolean loadNonPublic,
boolean loadAbstract,
boolean loadRoot)
Load a list of beans whose class is type or implementation of the specified
type |
Iterable<T> |
load(Map<String,Object> options,
BeanSpec container,
Genie genie)
This method will load instances of all public and non-abstract classes that implements/extends the interface/class specified as
value option |
prioritypublic final Iterable<T> load(Map<String,Object> options, BeanSpec container, Genie genie)
This method will load instances of all public and non-abstract classes that implements/extends the interface/class specified as value option
options - must contains an entry indexed with “value” and the value should be a Class typecontainer - the bean spec of the container into which the element will be loadedgenie - the dependency injectorhintpublic final org.osgl.Osgl.Function<T,Boolean> filter(Map<String,Object> options, BeanSpec container)
This method returns a predicate function that test the bean instance against the class specified by hint. If the bean is an instance of the hint class, then the predicate function returns true otherwise it returns false
options - must contains an entry indexed with “value” and the value should be a Class typecontainer - the bean spec of the container into which the element will be loadedprotected abstract List<Class<? extends T>> load(Class<T> type, boolean loadNonPublic, boolean loadAbstract, boolean loadRoot)
Load a list of beans whose class is type or implementation of the specified type
type - the class or interface specificationloadNonPublic - specify if it should load non public classesloadAbstract - specify if it should load abstract classesCopyright © 2016–2018 OSGL (Open Source General Library). All rights reserved.