|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjodd.bean.LoadersManager
Bean loaders manager.
A bean loader is a class that "knows" how to populate a java bean from
given object. For example, the Map
bean loader iterates given
Map
, reads items and key/values pairs and sets beans property
that is named as items key with value of items value.
This class registers few default loaders. Most of default loaders are made
for j2sdk classes. However, there are loaders that are made for j2ee
classes, that may not exists on client system. Therefore, during the
registration of default classes, Class.forName
is used for
checking if certain class exists.
Constructor Summary | |
LoadersManager()
|
Method Summary | |
static Loader |
get(java.lang.Class key)
Returns loader for the specific object type. |
static Loader |
get(java.lang.Object obj)
Performs more throughly search for bean loader. |
static java.util.Map |
getMap()
Returns the Map where all loaders are registered. |
static void |
register(java.lang.Class key,
Loader load)
Registers a loader for an objects of specific type. |
static void |
registerDefaults()
Registers default set of loaders. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public LoadersManager()
Method Detail |
public static java.util.Map getMap()
public static void registerDefaults()
Important note: class that doesn'tcome with JDK is first being examined
for existence. Examination is done with Class.forName()
If class exists, it will be registered. If not, it will be skipped.
register(java.lang.Class, jodd.bean.Loader)
public static void register(java.lang.Class key, Loader load)
key
- type of object that will be used by loader to populate bean.load
- loader object that populates a bean.registerDefaults()
public static Loader get(java.lang.Class key)
key
- type of object that will be used by loader to populate bean.
null
if no loader found.get(Class key)
public static Loader get(java.lang.Object obj)
obj
-
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |