public class FrameworkLookup
extends java.lang.Object
Constructor and Description |
---|
FrameworkLookup() |
Modifier and Type | Method and Description |
---|---|
static <T> Maybe<T> |
lookup(java.lang.Class<T> clazz)
Find an instance of the given class in the framework.
|
static <T> Maybe<T> |
lookup(java.lang.Class<T> clazz,
java.lang.ClassLoader loader)
Find an instance of the given class in the framework.
|
static <T> java.lang.Iterable<T> |
lookupAll(java.lang.Class<T> clazz)
Find all instances of the given class in the framework.
|
static <T> java.lang.Iterable<T> |
lookupAll(java.lang.Class<T> clazz,
java.lang.ClassLoader loader)
Find all instances of the given class in the framework.
|
public static <T> Maybe<T> lookup(java.lang.Class<T> clazz)
T
- The type for the class.clazz
- The class (typically the class of an interface) to search in the framework.public static <T> Maybe<T> lookup(java.lang.Class<T> clazz, java.lang.ClassLoader loader)
T
- The type for the class.clazz
- The class (typically the class of an interface) to search in the framework.loader
- If falling back to ServiceLoader, this class loader is used to load the class. If null,
the system class loader (or, failing that, the bootstrap class loader) is used.public static <T> java.lang.Iterable<T> lookupAll(java.lang.Class<T> clazz)
T
- The type for the class.clazz
- The class (typically the class of an interface) to search in the framework.public static <T> java.lang.Iterable<T> lookupAll(java.lang.Class<T> clazz, java.lang.ClassLoader loader)
T
- The type for the class.clazz
- The class (typically the class of an interface) to search in the framework.loader
- If falling back to ServiceLoader, this class loader is used to load the class. If null,
the system class loader (or, failing that, the bootstrap class loader) is used.