类 MapFactoryBean
- java.lang.Object
- org.springframework.beans.factory.config.AbstractFactoryBean<Map<Object,Object>>
- org.springframework.beans.factory.config.MapFactoryBean
- 所有已实现的接口:
Aware
,BeanClassLoaderAware
,BeanFactoryAware
,DisposableBean
,FactoryBean<Map<Object,Object>>
,InitializingBean
public class MapFactoryBean extends AbstractFactoryBean<Map<Object,Object>>
Simple factory for shared Map instances. Allows for central setup of Maps via the "map" element in XML bean definitions.- 从以下版本开始:
- 09.12.2003
- 作者:
- Juergen Hoeller
- 另请参阅:
SetFactoryBean
,ListFactoryBean
字段概要
从类继承的字段 org.springframework.beans.factory.config.AbstractFactoryBean
logger
从接口继承的字段 org.springframework.beans.factory.FactoryBean
OBJECT_TYPE_ATTRIBUTE
构造器概要
构造器 构造器 说明 MapFactoryBean()
方法概要
所有方法 实例方法 具体方法 修饰符和类型 方法 说明 protected Map<Object,Object>
createInstance()
Template method that subclasses must override to construct the object returned by this factory.Class<Map>
getObjectType()
This abstract method declaration mirrors the method in the FactoryBean interface, for a consistent offering of abstract template methods.void
setSourceMap(Map<?,?> sourceMap)
Set the source Map, typically populated via XML "map" elements.void
setTargetMapClass(Class<? extends Map> targetMapClass)
Set the class to use for the target Map.从类继承的方法 org.springframework.beans.factory.config.AbstractFactoryBean
afterPropertiesSet, destroy, destroyInstance, getBeanFactory, getBeanTypeConverter, getEarlySingletonInterfaces, getObject, isSingleton, setBeanClassLoader, setBeanFactory, setSingleton
构造器详细资料
MapFactoryBean
public MapFactoryBean()
方法详细资料
setSourceMap
public void setSourceMap(Map<?,?> sourceMap)
Set the source Map, typically populated via XML "map" elements.
setTargetMapClass
public void setTargetMapClass(@Nullable Class<? extends Map> targetMapClass)
Set the class to use for the target Map. Can be populated with a fully qualified class name when defined in a Spring application context.Default is a linked HashMap, keeping the registration order.
- 另请参阅:
LinkedHashMap
getObjectType
public Class<Map> getObjectType()
从类复制的说明:AbstractFactoryBean
This abstract method declaration mirrors the method in the FactoryBean interface, for a consistent offering of abstract template methods.- 指定者:
getObjectType
在接口中FactoryBean<Map<Object,Object>>
- 指定者:
getObjectType
在类中AbstractFactoryBean<Map<Object,Object>>
- 返回:
- the type of object that this FactoryBean creates, or
null
if not known at the time of the call - 另请参阅:
FactoryBean.getObjectType()
createInstance
protected Map<Object,Object> createInstance()
从类复制的说明:AbstractFactoryBean
Template method that subclasses must override to construct the object returned by this factory.Invoked on initialization of this FactoryBean in case of a singleton; else, on each
AbstractFactoryBean.getObject()
call.- 指定者:
createInstance
在类中AbstractFactoryBean<Map<Object,Object>>
- 返回:
- the object returned by this factory
- 另请参阅:
AbstractFactoryBean.getObject()