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

public Class SetFactoryBean

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

Simple factory for shared Set instances. Allows for central setup of Sets via the "set" element in XML bean definitions.
Author
Juergen Hoeller
Since
09.12.2003
See Also
ListFactoryBean, MapFactoryBean

Field Summary

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

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
protected Set<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<Set<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
setSourceSet(Set<?> sourceSet)

Set the source Set, typically populated via XML "set" elements.

public void
setTargetSetClass(Class<? extends Set<E>> targetSetClass)

Set the class to use for the target Set.

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

Field Detail

sourceSetback to summary
private Set<?> sourceSet
Annotations
@Nullable
targetSetClassback to summary
private Class<? extends Set<E>> targetSetClass
Annotations
@SuppressWarnings:rawtypes
@Nullable

Constructor Detail

SetFactoryBeanback to summary
public SetFactoryBean()

Method Detail

createInstanceback to summary
protected Set<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:Set<Object>

the object returned by this factory

Annotations
@Override
@SuppressWarnings:unchecked
getObjectTypeback to summary
public Class<Set<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<Set<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
setSourceSetback to summary
public void setSourceSet(Set<?> sourceSet)

Set the source Set, typically populated via XML "set" elements.

setTargetSetClassback to summary
public void setTargetSetClass(Class<? extends Set<E>> targetSetClass)

Set the class to use for the target Set. Can be populated with a fully qualified class name when defined in a Spring application context.

Default is a linked HashSet, keeping the registration order.

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