public class

MapFactoryBean

extends AbstractFactoryBean<T>
java.lang.Object
   ↳ org.springframework.beans.factory.config.AbstractFactoryBean<T>
     ↳ org.springframework.beans.factory.config.MapFactoryBean

Class Overview

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

Summary

[Expand]
Inherited Fields
From class org.springframework.beans.factory.config.AbstractFactoryBean
Public Constructors
MapFactoryBean()
Public Methods
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 targetMapClass)
Set the class to use for the target Map.
Protected Methods
Map createInstance()
Template method that subclasses must override to construct the object returned by this factory.
[Expand]
Inherited Methods
From class org.springframework.beans.factory.config.AbstractFactoryBean
From class java.lang.Object
From interface org.springframework.beans.factory.BeanClassLoaderAware
From interface org.springframework.beans.factory.BeanFactoryAware
From interface org.springframework.beans.factory.DisposableBean
From interface org.springframework.beans.factory.FactoryBean
From interface org.springframework.beans.factory.InitializingBean

Public Constructors

public MapFactoryBean ()

Also: SpringBeans

Public Methods

public Class<Map> getObjectType ()

Also: SpringBeans

This abstract method declaration mirrors the method in the FactoryBean interface, for a consistent offering of abstract template methods.

Returns
  • the type of object that this FactoryBean creates, or null if not known at the time of the call

public void setSourceMap (Map sourceMap)

Also: SpringBeans

Set the source Map, typically populated via XML "map" elements.

public void setTargetMapClass (Class targetMapClass)

Also: SpringBeans

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.

See Also

Protected Methods

protected Map createInstance ()

Also: SpringBeans

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 getObject() call.

Returns
  • the object returned by this factory