|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectde.kleopatra.view.factory.DefaultComponentTypeMap
Default implementation.
Handles storage of classnames/classes, delegates classloading to ResourceManager, instantiates comps, provides hook for custom factories.
NOTE: the custom hook is processed after looking for a mapped class. This guarantees that type mappings added at runtime take precedence over hardcoded lookups.
Field Summary | |
protected java.util.Map |
componentMap
|
protected java.util.Map |
containerMap
|
protected static java.util.logging.Logger |
LOGGER
|
protected java.util.Set |
scrollableTypes
|
Constructor Summary | |
DefaultComponentTypeMap()
|
Method Summary | |
void |
addComponentType(java.lang.Object componentType,
java.lang.Class clazz)
|
void |
addComponentType(java.lang.Object componentType,
java.lang.String className)
|
void |
addContainerType(java.lang.Object componentType,
java.lang.Class clazz)
|
void |
addContainerType(java.lang.Object containerType,
java.lang.String className)
|
void |
addScrollableType(java.lang.Object scrollableType)
|
protected java.util.Map |
createMap()
|
protected java.util.Set |
createSet()
|
protected java.lang.Object |
factoryHook(java.lang.Object componentType)
hook for subclasses to use custom component factories. |
protected java.lang.Class |
getClass(java.lang.Object componentType)
returns a class for a given componentTyp null if not found or error. |
protected java.lang.Class |
getClassForEntry(java.lang.Object classEntry)
|
java.lang.Object |
getComponentInstance(java.lang.Object componentType)
returns an instance of a component as appropriate for the generic type componentType. |
protected java.util.Map |
getComponentMap()
|
java.lang.Object |
getComponentType(java.lang.Class clazz)
returns an identifier for the given class or null if not found. |
java.util.Set |
getComponentTypes()
returns a Collection of all generic component types. |
protected java.util.Map |
getContainerMap()
|
java.util.Set |
getContainerTypes()
returns a Collection of all generic container types. |
protected java.util.Collection |
getScrollableTypes()
|
boolean |
shouldScroll(java.lang.Object componentType)
|
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
protected java.util.Map componentMap
protected java.util.Map containerMap
protected java.util.Set scrollableTypes
protected static final java.util.logging.Logger LOGGER
Constructor Detail |
public DefaultComponentTypeMap()
Method Detail |
public void addComponentType(java.lang.Object componentType, java.lang.String className)
addComponentType
in interface ComponentTypeMap
public void addContainerType(java.lang.Object containerType, java.lang.String className)
addContainerType
in interface ComponentTypeMap
public void addScrollableType(java.lang.Object scrollableType)
addScrollableType
in interface ComponentTypeMap
public boolean shouldScroll(java.lang.Object componentType)
shouldScroll
in interface ComponentTypeMap
public void addComponentType(java.lang.Object componentType, java.lang.Class clazz)
addComponentType
in interface ComponentTypeMap
public void addContainerType(java.lang.Object componentType, java.lang.Class clazz)
addContainerType
in interface ComponentTypeMap
public java.lang.Object getComponentInstance(java.lang.Object componentType)
Implementation note: guarantees to first check the registered class mapping before trying to use thefactoryHook
getComponentInstance
in interface ComponentTypeMap
public java.util.Set getComponentTypes()
ComponentTypeMap
getComponentTypes
in interface ComponentTypeMap
public java.util.Set getContainerTypes()
ComponentTypeMap
getContainerTypes
in interface ComponentTypeMap
public java.lang.Object getComponentType(java.lang.Class clazz)
getComponentType
in interface ComponentTypeMap
protected java.lang.Class getClass(java.lang.Object componentType)
protected java.lang.Class getClassForEntry(java.lang.Object classEntry) throws java.lang.ClassNotFoundException
java.lang.ClassNotFoundException
protected java.lang.Object factoryHook(java.lang.Object componentType)
protected java.util.Map getComponentMap()
protected java.util.Map getContainerMap()
protected java.util.Map createMap()
protected java.util.Collection getScrollableTypes()
protected java.util.Set createSet()
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |