public class

SetFactoryBean

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

Class Overview

Simple factory for shared Set instances. Allows for central setup of Sets via the "set" element in XML bean definitions.

Summary

[Expand]
Inherited Fields
From class org.springframework.beans.factory.config.AbstractFactoryBean
Public Constructors
SetFactoryBean()
Public Methods
Class<Set> getObjectType()
This abstract method declaration mirrors the method in the FactoryBean interface, for a consistent offering of abstract template methods.
void setSourceSet(Set sourceSet)
Set the source Set, typically populated via XML "set" elements.
void setTargetSetClass(Class targetSetClass)
Set the class to use for the target Set.
Protected Methods
Set 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 SetFactoryBean ()

Also: SpringBeans

Public Methods

public Class<Set> 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 setSourceSet (Set sourceSet)

Also: SpringBeans

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

public void setTargetSetClass (Class targetSetClass)

Also: SpringBeans

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.

See Also

Protected Methods

protected Set 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