|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.springframework.beans.factory.config.AbstractFactoryBean org.springframework.beans.factory.config.MapFactoryBean
Simple factory for shared Map instances. Allows for central setup of Maps via the "map" element in XML bean definitions.
Field Summary |
Fields inherited from class org.springframework.beans.factory.config.AbstractFactoryBean |
logger |
Constructor Summary | |
MapFactoryBean()
|
Method Summary | |
protected java.lang.Object |
createInstance()
Template method that subclasses must override to construct the object returned by this factory. |
java.lang.Class |
getObjectType()
Return the type of object that this FactoryBean creates, or null if not known in advance. |
void |
setSourceMap(java.util.Map sourceMap)
Set the source Map, typically populated via XML "map" elements. |
void |
setTargetMapClass(java.lang.Class targetMapClass)
Set the class to use for the target Map. |
Methods inherited from class org.springframework.beans.factory.config.AbstractFactoryBean |
afterPropertiesSet, getObject, isSingleton, setSingleton |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public MapFactoryBean()
Method Detail |
public void setSourceMap(java.util.Map sourceMap)
public void setTargetMapClass(java.lang.Class targetMapClass)
java.util.HashMap
.
HashMap
public java.lang.Class getObjectType()
FactoryBean
For a singleton, this can simply return getObject().getClass(), or even null, as autowiring will always check the actual objects for singletons. For prototypes, returning a meaningful type here is highly advisable, as autowiring will simply ignore them else.
ListableBeanFactory.getBeansOfType(java.lang.Class, boolean, boolean)
protected java.lang.Object createInstance()
AbstractFactoryBean
Invoked on initialization of this FactoryBean in case of a singleton; else, on each getObject() call.
createInstance
in class AbstractFactoryBean
AbstractFactoryBean.getObject()
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |