Save This Page
Home » spring-framework-2.5.4 » org.springframework » context » support » [javadoc | source]
org.springframework.context.support
public class: ResourceMapFactoryBean [javadoc | source]
java.lang.Object
   org.springframework.core.io.support.PropertiesLoaderSupport
      org.springframework.beans.factory.config.PropertiesFactoryBean
         org.springframework.context.support.ResourceMapFactoryBean

All Implemented Interfaces:
    ResourceLoaderAware, InitializingBean, FactoryBean

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.

Fields inherited from org.springframework.core.io.support.PropertiesLoaderSupport:
XML_FILE_EXTENSION,  logger
Method from org.springframework.context.support.ResourceMapFactoryBean Summary:
createInstance,   getObjectType,   getResource,   setResourceBasePath,   setResourceLoader
Methods from org.springframework.beans.factory.config.PropertiesFactoryBean:
afterPropertiesSet,   createInstance,   getObject,   getObjectType,   isSingleton,   setSingleton
Methods from org.springframework.core.io.support.PropertiesLoaderSupport:
loadProperties,   mergeProperties,   setFileEncoding,   setIgnoreResourceNotFound,   setLocalOverride,   setLocation,   setLocations,   setProperties,   setPropertiesArray,   setPropertiesPersister
Methods from java.lang.Object:
equals,   getClass,   hashCode,   notify,   notifyAll,   toString,   wait,   wait,   wait
Method from org.springframework.context.support.ResourceMapFactoryBean Detail:
 protected Object createInstance() throws IOException 
    Create the Map instance, populated with keys and Resource values.
 public Class getObjectType() 
 protected Resource getResource(String location) 
    Fetch the Resource handle for the given location, prepeding the resource base path.
 public  void setResourceBasePath(String resourceBasePath) 
    Set a base path to prepend to each resource location value in the properties file.

    E.g.: resourceBasePath="/images", value="/test.gif" -> location="/images/test.gif"

 public  void setResourceLoader(ResourceLoader resourceLoader)