|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjava.util.AbstractMap<K,V>
java.util.HashMap<K,V>
java.util.LinkedHashMap
org.progeeks.util.beans.BeanConfigurator
public class BeanConfigurator
Can hold property values for a bean and apply them on demand to a bean instance. This class can also be used to instantiate beans pre-configured. Property values are stored as entries in the Map.
Constructor Summary | |
---|---|
BeanConfigurator()
Constructs a bean configurator that is not specific to any bean class. |
|
BeanConfigurator(java.lang.Class beanClass)
Constructs a bean configurator that can instantiate and configure beans of the specified concrete class. |
Method Summary | |
---|---|
void |
addConfiguratorListener(ConfiguratorListener listener)
Adds a listener that will be notified whenever a new bean is created. |
void |
configureBean(java.lang.Object bean)
Configures the specified bean by applying the stored properties. |
java.lang.Object |
createBean()
Creates a configures a bean of this configurator's associated bean type. |
java.lang.Object |
createBean(java.lang.Object[] args)
Creates a configures a bean passing the specified arguments on the constructor. |
boolean |
equals(java.lang.Object obj)
|
protected void |
fireBeanCreated(java.lang.Object bean)
Notifies the registered ConfiguratorListeners about the specified bean creation. |
boolean |
getAppendCollections()
|
java.lang.Class |
getBeanClass()
Returns the bean class associated with this configurator or null if it is not specific to a given bean class. |
boolean |
getOverwriteExistingValues()
|
boolean |
hasConstructor(java.lang.Class[] types)
Returns true if the bean can be created with the specified argument types. |
boolean |
hasConstructor(java.lang.Object[] args)
Returns true if the bean can be created with the specified arguments. |
java.lang.Object |
put(java.lang.Object key,
java.lang.Object value)
Overridden to provide additional type-checking for key values. |
void |
removeConfiguratorListener(ConfiguratorListener listener)
Removes a previously registered configurator listener. |
void |
setAppendCollections(boolean flag)
Set to true collection based values should be appended to any existing collection. |
protected void |
setCollectionValue(java.lang.String name,
java.util.Collection value,
Inspector ins)
|
protected void |
setMapValue(java.lang.String name,
java.util.Map value,
Inspector ins)
|
void |
setOverwriteExistingValues(boolean flag)
Set to true if existing values should be overwritten. |
protected void |
setValue(java.lang.String name,
java.lang.Object value,
Inspector ins)
|
java.lang.String |
toString()
|
Methods inherited from class java.util.LinkedHashMap |
---|
clear, containsValue, get, removeEldestEntry |
Methods inherited from class java.util.HashMap |
---|
clone, containsKey, entrySet, isEmpty, keySet, putAll, remove, size, values |
Methods inherited from class java.util.AbstractMap |
---|
hashCode |
Methods inherited from class java.lang.Object |
---|
finalize, getClass, notify, notifyAll, wait, wait, wait |
Methods inherited from interface java.util.Map |
---|
containsKey, entrySet, hashCode, isEmpty, keySet, putAll, remove, size, values |
Constructor Detail |
---|
public BeanConfigurator()
public BeanConfigurator(java.lang.Class beanClass)
Method Detail |
---|
public boolean equals(java.lang.Object obj)
equals
in interface java.util.Map
equals
in class java.util.AbstractMap
public void setAppendCollections(boolean flag)
public boolean getAppendCollections()
public void setOverwriteExistingValues(boolean flag)
public boolean getOverwriteExistingValues()
public void addConfiguratorListener(ConfiguratorListener listener)
public void removeConfiguratorListener(ConfiguratorListener listener)
public java.lang.Class getBeanClass()
public void configureBean(java.lang.Object bean)
protected void setCollectionValue(java.lang.String name, java.util.Collection value, Inspector ins)
protected void setMapValue(java.lang.String name, java.util.Map value, Inspector ins)
protected void setValue(java.lang.String name, java.lang.Object value, Inspector ins)
public java.lang.Object createBean()
public java.lang.Object createBean(java.lang.Object[] args)
public boolean hasConstructor(java.lang.Object[] args)
public boolean hasConstructor(java.lang.Class[] types)
public java.lang.Object put(java.lang.Object key, java.lang.Object value)
put
in interface java.util.Map
put
in class java.util.HashMap
protected void fireBeanCreated(java.lang.Object bean)
public java.lang.String toString()
toString
in class java.util.AbstractMap
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |