org.springframework.beans.factory.config
Class MapFactoryBean


public class MapFactoryBean
implements FactoryBean, InitializingBean

Simple factory for shared Map instances. Allows for central setup of Maps via the "map" element in XML bean definitions.

Author:
Hans Gilde, Juergen Hoeller
Since: 09.12.2003

Method Summary
 voidafterPropertiesSet()
           
 ObjectgetObject()
           
 ClassgetObjectType()
           
 booleanisSingleton()
           
 voidsetSingleton(boolean singleton)
          Set if a singleton should be created, or a new object on each request else.
 voidsetSourceMap(Map sourceMap)
          Set the source Map, typically populated via XML "map" elements.
 voidsetTargetMapClass(Class targetMapClass)
          Set the class to use for the target Map.

Method Detail

afterPropertiesSet

public void afterPropertiesSet()

getObject

public Object getObject()

getObjectType

public Class getObjectType()

isSingleton

public boolean isSingleton()

setSingleton

public void setSingleton(boolean singleton)
Set if a singleton should be created, or a new object on each request else. Default is true.

setSourceMap

public void setSourceMap(Map sourceMap)
Set the source Map, typically populated via XML "map" elements.

setTargetMapClass

public void setTargetMapClass(Class targetMapClass)
Set the class to use for the target Map. Default is java.util.HashMap.
See Also:
HashMap

Association Links

to Class java.util.Map

to Class java.lang.Class

to Class java.util.Map