public class ELKIServiceRegistry
extends java.lang.Object
Modifier and Type | Class and Description |
---|---|
private static class |
ELKIServiceRegistry.Entry
Entry in the service registry.
|
Modifier and Type | Field and Description |
---|---|
private static java.lang.ClassLoader |
CLASSLOADER
Class loader
|
private static java.util.Map<java.lang.Class<?>,ELKIServiceRegistry.Entry> |
data
Registry data.
|
static java.lang.String |
FACTORY_POSTFIX
Factory class postfix.
|
(package private) static java.lang.Class<?> |
FAILED_LOAD
Value to abuse for failures.
|
private static Logging |
LOG
Class logger.
|
Modifier | Constructor and Description |
---|---|
private |
ELKIServiceRegistry()
Do not use constructor.
|
Modifier and Type | Method and Description |
---|---|
protected static boolean |
contains(java.lang.Class<?> c)
Test if a registry entry has already been created.
|
static java.util.List<java.lang.Class<?>> |
findAllImplementations(java.lang.Class<?> restrictionClass)
Find all implementations of a particular interface.
|
static java.util.List<java.lang.Class<?>> |
findAllImplementations(java.lang.Class<?> c,
boolean everything,
boolean parameterizable)
Find all implementations of a given class in the classpath.
|
static <C> java.lang.Class<? extends C> |
findImplementation(java.lang.Class<? super C> restrictionClass,
java.lang.String value)
Find an implementation of the given interface / super class, given a
relative class name or alias name.
|
protected static void |
register(java.lang.Class<?> parent,
java.lang.Class<?> clazz)
Register a class in the registry.
|
protected static void |
register(java.lang.Class<?> parent,
java.lang.String cname)
Register a class with the registry.
|
protected static void |
registerAlias(java.lang.Class<?> parent,
java.lang.String alias,
java.lang.String cname)
Register a class alias with the registry.
|
private static <C> java.lang.Class<?> |
tryAlternateNames(java.lang.Class<? super C> restrictionClass,
java.lang.String value,
ELKIServiceRegistry.Entry e)
Try loading alternative names.
|
private static java.lang.Class<?> |
tryLoadClass(java.lang.String value)
Attempt to load a class
|
private static final Logging LOG
private static final java.lang.ClassLoader CLASSLOADER
public static final java.lang.String FACTORY_POSTFIX
private static java.util.Map<java.lang.Class<?>,ELKIServiceRegistry.Entry> data
static final java.lang.Class<?> FAILED_LOAD
protected static void register(java.lang.Class<?> parent, java.lang.String cname)
parent
- Parent classcname
- Class nameprotected static void register(java.lang.Class<?> parent, java.lang.Class<?> clazz)
parent
- Classclazz
- Implementationprotected static void registerAlias(java.lang.Class<?> parent, java.lang.String alias, java.lang.String cname)
parent
- Parent classalias
- Alias namecname
- Class nameprivate static java.lang.Class<?> tryLoadClass(java.lang.String value)
value
- Class name to try.null
.protected static boolean contains(java.lang.Class<?> c)
c
- Classtrue
if a registry entry has been created.public static java.util.List<java.lang.Class<?>> findAllImplementations(java.lang.Class<?> restrictionClass)
restrictionClass
- Class to scan forpublic static java.util.List<java.lang.Class<?>> findAllImplementations(java.lang.Class<?> c, boolean everything, boolean parameterizable)
c
- Class restrictioneverything
- include interfaces, abstract and private classesparameterizable
- only return classes instantiable by the
parameterizable APIpublic static <C> java.lang.Class<? extends C> findImplementation(java.lang.Class<? super C> restrictionClass, java.lang.String value)
restrictionClass
- Restriction classvalue
- Class name, relative class name, or nickname.null
private static <C> java.lang.Class<?> tryAlternateNames(java.lang.Class<? super C> restrictionClass, java.lang.String value, ELKIServiceRegistry.Entry e)
C
- Generic typerestrictionClass
- Context class, for prepending a package name.value
- Class name requestede
- Cache entry, may be nullCopyright © 2019 ELKI Development Team. License information.