public class KRHub
extends java.lang.Object
KRHub object can easily become a container of references to other objects
or classes, organized in groups. To be able to register themselves with a KRHub,
objects must implement the KRAdapter protocol.
Within a single group there can not be more objects that declare the same type.| Modifier and Type | Field and Description |
|---|---|
static java.lang.String |
kKRDefaultAdapterGroup |
| Constructor and Description |
|---|
KRHub() |
| Modifier and Type | Method and Description |
|---|---|
java.lang.Object |
adapterForType(java.lang.String type)
Returns an object of the specified type, if such an object is currently registered in the default group.
|
java.lang.Object |
adapterForTypeInGroup(java.lang.String type,
java.lang.String group)
Returns an object of the specified type, if such an object is currently registered in the specified group.
|
java.util.HashMap<java.lang.String,java.lang.Object> |
adaptersForGroup(java.lang.String group)
Returns the list of available registered objects for a specified group.
|
void |
registerAdapter(java.lang.Object adapter)
Registers a new adapter to the default group.
|
void |
registerAdapterInGroup(java.lang.Object adapter,
java.lang.String group)
Registers a new adapter to a specific group
|
void |
registerClass(java.lang.Class<?> _class,
java.lang.String type)
Registers a class to the default group, under a specific type.
|
void |
registerClassInGroup(java.lang.Class<?> _class,
java.lang.String group,
java.lang.String type)
Registers a class to a specific group and a specific type.
|
public static final java.lang.String kKRDefaultAdapterGroup
public java.util.HashMap<java.lang.String,java.lang.Object> adaptersForGroup(java.lang.String group)
group - The required group.public void registerClassInGroup(java.lang.Class<?> _class,
java.lang.String group,
java.lang.String type)
_class - The class to register.group - The group to register the call into.type - The type of the registered class.public void registerClass(java.lang.Class<?> _class,
java.lang.String type)
_class - The class to registertype - The type of the registered class.public void registerAdapterInGroup(java.lang.Object adapter,
java.lang.String group)
adapter - The adapter to be registered. The object needs to implement KRAdapter.group - The group to register the adapter into.public void registerAdapter(java.lang.Object adapter)
adapter - The adapter to be registered. The object needs to implement KRAdapter.public java.lang.Object adapterForTypeInGroup(java.lang.String type,
java.lang.String group)
type - The required object type.group - The required group.null otherwise.public java.lang.Object adapterForType(java.lang.String type)
type - The required object type.null otherwise.