|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectca.nengo.config.ClassRegistry
public final class ClassRegistry
A registry of implementations of selected types of interest (subclasses and interface implementations). TODO: unit tests
Field Summary | |
---|---|
static java.lang.String |
IMPLS_LOCATION_PROPERTY
|
static java.lang.String |
TYPES_LOCATION_PROPERTY
|
Method Summary | |
---|---|
void |
addHierarchy(java.lang.Class<?> type)
As addRegisterableType(Class), but ancestors are added as well. |
void |
addRegisterableType(java.lang.Class<?> type)
Adds a class to the list of types whose implementations can be registered (only implementations of certain types can be registered). |
java.util.List<java.lang.Class<?>> |
getImplementations(java.lang.Class<?> type)
|
static ClassRegistry |
getInstance()
|
java.lang.Class<?>[] |
getRegisterableTypes()
|
void |
register(java.lang.Class<?> implementation)
Registers an implementation against any of the registerable types which it is assignable from. |
void |
register(java.util.jar.JarFile jar)
Registers public, non-abstract classes in the given Jar. |
void |
register(java.lang.String implementationName)
As register(Class), but by name. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final java.lang.String TYPES_LOCATION_PROPERTY
public static final java.lang.String IMPLS_LOCATION_PROPERTY
Method Detail |
---|
public static ClassRegistry getInstance()
public void addHierarchy(java.lang.Class<?> type)
type
- Type at bottom of hierarchypublic void addRegisterableType(java.lang.Class<?> type)
type
- Type to add to list of registerable typespublic java.lang.Class<?>[] getRegisterableTypes()
public void register(java.lang.Class<?> implementation)
implementation
- Class to register as an implementation of matching registerable typespublic void register(java.lang.String implementationName) throws java.lang.ClassNotFoundException
implementationName
- Name of implementation to register
java.lang.ClassNotFoundException
public void register(java.util.jar.JarFile jar) throws java.lang.ClassNotFoundException
jar
- Jar from which to draw classes to register
java.lang.ClassNotFoundException
public java.util.List<java.lang.Class<?>> getImplementations(java.lang.Class<?> type)
type
- A registerable type
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |