|
jInfer | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcz.cuni.mff.ksi.jinfer.base.utils.ModuleSelectionHelper
public final class ModuleSelectionHelper
Logic for looking up service provider implementations based on their name.
| Nested Class Summary | |
|---|---|
static class |
ModuleSelectionHelper.Fallback
Defines what should happen if none of the implementations has the name we look for. |
| Method Summary | ||
|---|---|---|
static
|
lookupImpl(Class<T> clazz,
String name)
Looks up implementation of requested interface based on its name. |
|
static
|
lookupImpl(Class<T> clazz,
String name,
ModuleSelectionHelper.Fallback fallback)
Looks up implementation of requested interface based on its name. |
|
static
|
lookupImpls(Class<T> clazz)
Returns a list of all the implementations of requested interface registered via ServiceProvider. |
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Method Detail |
|---|
public static <T extends NamedModule> List<T> lookupImpls(Class<T> clazz)
ServiceProvider.
T - Interface for which the implementations to be found.
Must extend NamedModule.clazz - Interface for which the implementations to be found.
Must extend NamedModule.
NamedModule.getDisplayName() of all implementations of modules registered as
ServiceProvider implementing the requested
interface.
public static <T extends NamedModule> T lookupImpl(Class<T> clazz,
String name)
T - Interface to be found. Must extend NamedModule.clazz - Interface to be found. Must extend NamedModule.name - Module name. This parameter will be compared to the names
(NamedModule.getName())
of all implementations of the requested interface.
public static <T extends NamedModule> T lookupImpl(Class<T> clazz,
String name,
ModuleSelectionHelper.Fallback fallback)
T - Interface to be found. Must extend NamedModule.clazz - Interface to be found. Must extend NamedModule.name - Module name. This parameter will be compared to the names
(NamedModule.getName())
of all implementations of the requested interface.fallback - Defines what to do if no implementation with correct name
is found.
ModuleSelectionHelper.Fallback.
|
jInfer | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||