站内搜索: 请输入搜索关键词
当前页面: 在线文档首页 > Spring Framework 2.0.5 API 文档英文版

SetFactoryBean (Spring Framework API 2.0) - Spring Framework 2.0.5 API 文档英文版

The Spring Framework

org.springframework.beans.factory.config
Class SetFactoryBean

java.lang.Object
  extended by org.springframework.beans.factory.config.AbstractFactoryBean
      extended by org.springframework.beans.factory.config.SetFactoryBean
All Implemented Interfaces:
BeanFactoryAware, DisposableBean, FactoryBean, InitializingBean

public class SetFactoryBean
extends AbstractFactoryBean

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

Since:
09.12.2003
Author:
Juergen Hoeller
See Also:
ListFactoryBean, MapFactoryBean

Field Summary
 
Fields inherited from class org.springframework.beans.factory.config.AbstractFactoryBean
logger
 
Constructor Summary
SetFactoryBean()
           
 
Method Summary
protected  Object createInstance()
          Template method that subclasses must override to construct the object returned by this factory.
 Class getObjectType()
          This abstract method declaration shadows the method in the FactoryBean interface.
 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.
 
Methods inherited from class org.springframework.beans.factory.config.AbstractFactoryBean
afterPropertiesSet, destroy, destroyInstance, getBeanFactory, getBeanTypeConverter, getEarlySingletonInterfaces, getObject, isSingleton, setBeanFactory, setSingleton
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SetFactoryBean

public SetFactoryBean()
Method Detail

setSourceSet

public void setSourceSet(Set sourceSet)
Set the source Set, typically populated via XML "set" elements.


setTargetSetClass

public void setTargetSetClass(Class 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. If no linked Set implementation is available, a plain HashSet will be used as fallback (not keeping the registration order).

See Also:
CollectionFactory.createLinkedSetIfPossible(int)

getObjectType

public Class getObjectType()
Description copied from class: AbstractFactoryBean
This abstract method declaration shadows the method in the FactoryBean interface. This is necessary to make the getEarlySingletonInterfaces implementation in this class work on Sun's JDK 1.3 classic VM, which can't find the method when executing getEarlySingletonInterfaces else.

Specified by:
getObjectType in interface FactoryBean
Specified by:
getObjectType in class AbstractFactoryBean
Returns:
the type of object that this FactoryBean creates, or null if not known at the time of the call
See Also:
FactoryBean.getObjectType(), AbstractFactoryBean.getEarlySingletonInterfaces()

createInstance

protected Object createInstance()
Description copied from class: AbstractFactoryBean
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 AbstractFactoryBean.getObject() call.

Specified by:
createInstance in class AbstractFactoryBean
Returns:
the object returned by this factory
See Also:
AbstractFactoryBean.getObject()

The Spring Framework

Copyright © 2002-2007 The Spring Framework.