jodd.bean
Class LoadersManager

java.lang.Object
  extended byjodd.bean.LoadersManager

public class LoadersManager
extends java.lang.Object

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

LoadersManager

public LoadersManager()
Method Detail

getMap

public static java.util.Map getMap()
Returns the Map where all loaders are registered.

Returns:
loaders Map

registerDefaults

public static void registerDefaults()
Registers default set of loaders.

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.

See Also:
register(java.lang.Class, jodd.bean.Loader)

register

public static void register(java.lang.Class key,
                            Loader load)
Registers a loader for an objects of specific type.

Parameters:
key - type of object that will be used by loader to populate bean.
load - loader object that populates a bean.
See Also:
registerDefaults()

get

public static Loader get(java.lang.Class key)
Returns loader for the specific object type.

Parameters:
key - type of object that will be used by loader to populate bean.
Returns:
loader for objects of specific type, null if no loader found.
See Also:
get(Class key)

get

public static Loader get(java.lang.Object obj)
Performs more throughly search for bean loader. It examines all available loaders and returns the first that matches the object.

Parameters:
obj -
Returns:
loader


Jodd v0.24.5 Javadoc