|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectorg.pf.plugin.ClassRegistry<T>
public class ClassRegistry<T>
A class registry is a container that keeps classes registered under a logical key. For a query by key it can return
| Constructor Summary | |
|---|---|
ClassRegistry()
Initialize the new instance with default values. |
|
ClassRegistry(java.lang.Class<T> typeOfRegisteredClasses)
Initialize the new instance with a type all classes that are registered must comply to. |
|
| Method Summary | |
|---|---|
java.lang.Class[] |
classes()
Returns all class objects that are currently in this registry. |
java.lang.String[] |
classNames()
Returns all class names of the classes that are currently in this registry. |
java.lang.Class<T> |
getClass(java.lang.Object key)
Returns the class which is registered under the given key. |
ClassInfo<T> |
getClassInfo(java.lang.String key)
Returns the class information object stored under the given key or null if nothing is found. |
java.lang.String |
getClassName(java.lang.Object key)
Returns the name of the class which is registered under the given key. |
java.lang.String[] |
keys()
Returns all keys known in this registry. |
T |
newInstance(java.lang.Object key)
Returns a new instance of the class which is registered under the given key. |
void |
put(java.lang.Object key,
java.lang.Class<T> aClass)
Registers the given class under the specified key. |
void |
put(java.lang.Object key,
java.lang.String className)
Registers the class with the given name under the specified key. |
boolean |
register(java.lang.Object key,
java.lang.Class<T> aClass)
Registers the class under the specified key. |
boolean |
register(java.lang.Object key,
java.lang.String className)
Registers the class with the given name under the specified key. |
boolean |
remove(java.lang.Object key)
Removes the entry in the registry which is defined by the given key. |
ClassInfo[] |
values()
Returns all class info objects that are currently in this registry. |
| Methods inherited from class java.lang.Object |
|---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public ClassRegistry()
public ClassRegistry(java.lang.Class<T> typeOfRegisteredClasses)
typeOfRegisteredClasses - The type to which the classes that can be
registered must be compatible to| Method Detail |
|---|
public java.lang.String getClassName(java.lang.Object key)
key - The key under which the class is registeredpublic java.lang.Class<T> getClass(java.lang.Object key)
key - The key under which the class is registeredpublic T newInstance(java.lang.Object key)
key - The key under which the class is registered
public boolean register(java.lang.Object key,
java.lang.String className)
key - The key under which the class is registeredclassName - The fully qualified name of the class
public void put(java.lang.Object key,
java.lang.String className)
throws ClassRegistryException
key - The key under which the class is registeredclassName - The fully qualified name of the class
ClassRegistryException - If the class can't be found or if it is of
the wrong type or can't be instantiated
public boolean register(java.lang.Object key,
java.lang.Class<T> aClass)
key - The key under which the class is registeredaClass - The class to be registered
public void put(java.lang.Object key,
java.lang.Class<T> aClass)
throws ClassRegistryException
key - The key under which the class is registeredaClass - The class to be registered
ClassRegistryException - If the class is of the wrong type or
can't be instantiatedpublic boolean remove(java.lang.Object key)
public java.lang.String[] keys()
public ClassInfo[] values()
public java.lang.Class[] classes()
public java.lang.String[] classNames()
public ClassInfo<T> getClassInfo(java.lang.String key)
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||