sam.toolkit
Class NamedClassRegistry
java.lang.Object
|
+--sam.toolkit.ClassRegistry
|
+--sam.toolkit.NamedClassRegistry
- public class NamedClassRegistry
- extends ClassRegistry
Class registry that keeps trace of registration names
associated to specific names.
Constructor Summary |
NamedClassRegistry(java.lang.Class baseType,
java.lang.String description)
Builds a new NamedClassRegistry for specified base type and
specified description. |
Method Summary |
java.lang.String |
getName(java.lang.Class type)
|
boolean |
register(java.lang.Class target,
java.lang.String name)
Registers a new target as name |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
NamedClassRegistry
public NamedClassRegistry(java.lang.Class baseType,
java.lang.String description)
- Builds a new
NamedClassRegistry
for specified base type and
specified description.
register
public boolean register(java.lang.Class target,
java.lang.String name)
throws java.lang.ClassCastException
- Registers a new target as
name
- Overrides:
register
in class ClassRegistry
- Returns:
true
iff the registration was successfull.
This is the case iff target
is a subtype of baseType
,
its ClassLoader
allows introspection and it defines a public
no-argument constructor.
java.lang.ClassCastException
getName
public java.lang.String getName(java.lang.Class type)