|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.springframework.beans.factory.config.AbstractFactoryBean
org.springframework.beans.factory.config.PropertiesFactoryBean
org.springframework.context.support.ResourceMapFactoryBean
FactoryBean that creates a Map with String keys and Resource values from properties, interpreting passed-in String values as resource locations.
Extends PropertiesFactoryBean to inherit the capability of defining local properties and loading from properties files.
Implements the ResourceLoaderAware interface to automatically use the context ResourceLoader if running in an ApplicationContext. Uses DefaultResourceLoader else.
DefaultResourceLoader
Field Summary |
Fields inherited from class org.springframework.beans.factory.config.AbstractFactoryBean |
logger |
Constructor Summary | |
ResourceMapFactoryBean()
|
Method Summary | |
protected java.lang.Object |
createInstance()
Template method that subclasses must override to construct the object returned by this factory. |
java.lang.Class |
getObjectType()
Return the type of object that this FactoryBean creates, or null if not known in advance. |
void |
setResourceBasePath(java.lang.String resourceBasePath)
Set a base path to prepend to each resource location value in the properties file. |
void |
setResourceLoader(ResourceLoader resourceLoader)
Set the ResourceLoader that this object runs in. |
Methods inherited from class org.springframework.beans.factory.config.PropertiesFactoryBean |
loadProperties, mergeProperties, setFileEncoding, setLocation, setLocations, setProperties, setPropertiesPersister |
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 ResourceMapFactoryBean()
Method Detail |
public void setResourceBasePath(java.lang.String resourceBasePath)
E.g.: resourceBasePath="/images", value="/test.gif" -> location="/images/test.gif"
public void setResourceLoader(ResourceLoader resourceLoader)
ResourceLoaderAware
Invoked after population of normal bean properties but before an init callback like InitializingBean's afterPropertiesSet or a custom init-method. Invoked before ApplicationContextAware's setApplicationContext.
setResourceLoader
in interface ResourceLoaderAware
resourceLoader
- ResourceLoader object to be used by this objectpublic java.lang.Class getObjectType()
FactoryBean
For a singleton, this can simply return getObject().getClass(), or even null, as autowiring will always check the actual objects for singletons. For prototypes, returning a meaningful type here is highly advisable, as autowiring will simply ignore them else.
getObjectType
in interface FactoryBean
getObjectType
in class PropertiesFactoryBean
protected java.lang.Object createInstance() throws java.lang.Exception
AbstractFactoryBean
Invoked on initialization of this FactoryBean in case of a singleton; else, on each getObject() call.
createInstance
in class PropertiesFactoryBean
java.lang.Exception
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |