Class ListFactoryBean
java.lang.Object
org.springframework.beans.factory.config.AbstractFactoryBean<List<Object>>
org.springframework.beans.factory.config.ListFactoryBean
- All Implemented Interfaces:
Aware,BeanClassLoaderAware,BeanFactoryAware,DisposableBean,FactoryBean<List<Object>>,InitializingBean
Simple factory for shared List instances. Allows for central setup
of Lists via the "list" element in XML bean definitions.
- Since:
- 09.12.2003
- Author:
- Juergen Hoeller
- See Also:
-
Field Summary
Fields inherited from class org.springframework.beans.factory.config.AbstractFactoryBean
loggerFields inherited from interface org.springframework.beans.factory.FactoryBean
OBJECT_TYPE_ATTRIBUTE -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionTemplate method that subclasses must override to construct the object returned by this factory.This abstract method declaration mirrors the method in the FactoryBean interface, for a consistent offering of abstract template methods.voidsetSourceList(List<?> sourceList) Set the source List, typically populated via XML "list" elements.voidsetTargetListClass(Class<? extends List> targetListClass) Set the class to use for the target List.Methods inherited from class org.springframework.beans.factory.config.AbstractFactoryBean
afterPropertiesSet, destroy, destroyInstance, getBeanFactory, getBeanTypeConverter, getEarlySingletonInterfaces, getObject, isSingleton, setBeanClassLoader, setBeanFactory, setSingleton
-
Constructor Details
-
ListFactoryBean
public ListFactoryBean()
-
-
Method Details
-
setSourceList
Set the source List, typically populated via XML "list" elements. -
setTargetListClass
Set the class to use for the target List. Can be populated with a fully qualified class name when defined in a Spring application context.Default is a
java.util.ArrayList.- See Also:
-
getObjectType
Description copied from class:AbstractFactoryBeanThis abstract method declaration mirrors the method in the FactoryBean interface, for a consistent offering of abstract template methods.- Specified by:
getObjectTypein interfaceFactoryBean<List<Object>>- Specified by:
getObjectTypein classAbstractFactoryBean<List<Object>>- Returns:
- the type of object that this FactoryBean creates,
or
nullif not known at the time of the call - See Also:
-
createInstance
Description copied from class:AbstractFactoryBeanTemplate 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.- Specified by:
createInstancein classAbstractFactoryBean<List<Object>>- Returns:
- the object returned by this factory
- See Also:
-