Top Description Fields Constructors Methods
org.springframework.beans.factory.config

public Class ListFactoryBean

extends AbstractFactoryBean<List<Object>>
Class Inheritance
Imports
java.util.ArrayList, .List, org.springframework.beans.BeanUtils, .TypeConverter, org.springframework.core.ResolvableType, org.springframework.lang.Nullable

Simple factory for shared List instances. Allows for central setup of Lists via the "list" element in XML bean definitions.
Author
Juergen Hoeller
Since
09.12.2003
See Also
SetFactoryBean, MapFactoryBean

Field Summary

Modifier and TypeField and Description
private List<?>
private Class<? extends List<E>>
Inherited from org.springframework.beans.factory.config.AbstractFactoryBean:
logger

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
protected List<Object>
createInstance()

Implements abstract org.springframework.beans.factory.config.AbstractFactoryBean.createInstance.

Template method that subclasses must override to construct the object returned by this factory.

public Class<List<E>>
getObjectType()

Implements abstract org.springframework.beans.factory.config.AbstractFactoryBean.getObjectType.

Implements org.springframework.beans.factory.FactoryBean.getObjectType.

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

public void
setSourceList(List<?> sourceList)

Set the source List, typically populated via XML "list" elements.

public void
setTargetListClass(Class<? extends List<E>> targetListClass)

Set the class to use for the target List.

Inherited from org.springframework.beans.factory.config.AbstractFactoryBean:
afterPropertiesSetdestroydestroyInstancegetBeanFactorygetBeanTypeConvertergetEarlySingletonInterfacesgetObjectisSingletonsetBeanClassLoadersetBeanFactorysetSingleton

Field Detail

sourceListback to summary
private List<?> sourceList
Annotations
@Nullable
targetListClassback to summary
private Class<? extends List<E>> targetListClass
Annotations
@SuppressWarnings:rawtypes
@Nullable

Constructor Detail

ListFactoryBeanback to summary
public ListFactoryBean()

Method Detail

createInstanceback to summary
protected List<Object> createInstance()

Implements abstract org.springframework.beans.factory.config.AbstractFactoryBean.createInstance.

Doc from org.springframework.beans.factory.config.AbstractFactoryBean.createInstance.

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:List<Object>

the object returned by this factory

Annotations
@Override
@SuppressWarnings:unchecked
getObjectTypeback to summary
public Class<List<E>> getObjectType()

Implements abstract org.springframework.beans.factory.config.AbstractFactoryBean.getObjectType.

Implements org.springframework.beans.factory.FactoryBean.getObjectType.

Doc from org.springframework.beans.factory.config.AbstractFactoryBean.getObjectType.

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

Returns:Class<List<E>>

Doc from org.springframework.beans.factory.FactoryBean.getObjectType.

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

Annotations
@Override
@SuppressWarnings:rawtypes
setSourceListback to summary
public void setSourceList(List<?> sourceList)

Set the source List, typically populated via XML "list" elements.

setTargetListClassback to summary
public void setTargetListClass(Class<? extends List<E>> targetListClass)

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.

Annotations
@SuppressWarnings:rawtypes
See Also
java.util.ArrayList