Class KRHub
java.lang.Object
com.appscend.hub.KRHub
- Direct Known Subclasses:
APSMediaPlayer
A
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.-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionadapterForType(String type) Returns an object of the specified type, if such an object is currently registered in the default group.adapterForTypeInGroup(String type, String group) Returns an object of the specified type, if such an object is currently registered in the specified group.adaptersForGroup(String group) Returns the list of available registered objects for a specified group.voidregisterAdapter(Object adapter) Registers a new adapter to the default group.voidregisterAdapterInGroup(Object adapter, String group) Registers a new adapter to a specific groupvoidregisterClass(Class<?> _class, String type) Registers a class to the default group, under a specific type.voidregisterClassInGroup(Class<?> _class, String group, String type) Registers a class to a specific group and a specific type.
-
Field Details
-
kKRDefaultAdapterGroup
- See Also:
-
-
Constructor Details
-
KRHub
public KRHub()
-
-
Method Details
-
adaptersForGroup
Returns the list of available registered objects for a specified group.- Parameters:
group- The required group.- Returns:
- A dictionary containing all objects registered for the required group. The dictionary keys are the types, as specified by the objects.
-
registerClassInGroup
Registers a class to a specific group and a specific type. Upon requesting a new object from this group and type, a new object of the registered class will be instantiated and returned.- Parameters:
_class- The class to register.group- The group to register the call into.type- The type of the registered class.
-
registerClass
Registers a class to the default group, under a specific type. Upon requesting a new object from this type from the default group, a new object of the registered class will be instantiated and returned.- Parameters:
_class- The class to registertype- The type of the registered class.
-
registerAdapterInGroup
-
registerAdapter
-
adapterForTypeInGroup
-
adapterForType
-