jodd.bean
Class BeanLoaderManager

java.lang.Object
  extended by jodd.bean.BeanLoaderManager

public class BeanLoaderManager
extends Object

Manager for BeanLoader instances that populates java beans from various sources.


Field Summary
protected static Map<Class,BeanLoader> loaders
           
 
Constructor Summary
BeanLoaderManager()
           
 
Method Summary
static BeanLoader lookup(Class type)
          Returns loader for the specific object type.
static BeanLoader lookup(Object source)
          Performs more thoroughly search for bean loader.
static void register(Class type, BeanLoader load)
          Registers loader for an objects of specific type.
static void registerDefaults()
          Registers default set of loaders.
static void unregister(Class type)
           
static void unregisterAll()
          Unregisters all loaders.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

loaders

protected static final Map<Class,BeanLoader> loaders
Constructor Detail

BeanLoaderManager

public BeanLoaderManager()
Method Detail

unregisterAll

public static void unregisterAll()
Unregisters all loaders.


registerDefaults

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

Important note: class that doesn't come 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.BeanLoader)

register

public static void register(Class type,
                            BeanLoader load)
Registers loader for an objects of specific type.

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

unregister

public static void unregister(Class type)

lookup

public static BeanLoader lookup(Class type)
Returns loader for the specific object type.

Parameters:
type - type of object that will be used by loader to populate bean.
Returns:
loader for objects of specific type, null if no loader found.

lookup

public static BeanLoader lookup(Object source)
Performs more thoroughly search for bean loader. It examines all available loaders and returns the first that matches the object type.