|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.springframework.beans.factory.config.AbstractFactoryBean org.springframework.beans.factory.config.SetFactoryBean
Simple factory for shared Set instances. Allows for central setup of Sets via the "set" element in XML bean definitions.
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()
Return the type of object that this FactoryBean creates, or null if not known in advance. |
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, getObject, isSingleton, setSingleton |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public SetFactoryBean()
Method Detail |
public void setSourceSet(Set sourceSet)
public void setTargetSetClass(Class targetSetClass)
java.util.HashSet
.
HashSet
public Class getObjectType()
FactoryBean
For a singleton, this should try to avoid singleton creation as far as possible; it should rather estimate the type in advance. For prototypes, returning a meaningful type here is advisable too.
This method can be called before this FactoryBean has been fully initialized. It must not rely on state created during initialization; of course, it can still use such state if available.
NOTE: Autowiring will simply ignore FactoryBeans that return null here. Therefore it is highly recommended to implement this method properly, using the current state of the FactoryBean.
ListableBeanFactory.getBeansOfType(java.lang.Class)
protected Object createInstance()
AbstractFactoryBean
Invoked on initialization of this FactoryBean in case of
a singleton; else, on each getObject()
call.
createInstance
in class AbstractFactoryBean
AbstractFactoryBean.getObject()
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |