## org.springframework.jdbc.config
Class SortedResourcesFactoryBean

    java.lang.Object
      org.springframework.beans.factory.config.AbstractFactoryBean<Resource[]>
          org.springframework.jdbc.config.SortedResourcesFactoryBean

All Implemented Interfaces:
  Aware, BeanClassLoaderAware, BeanFactoryAware, DisposableBean, FactoryBean<Resource[]>, InitializingBean, ResourceLoaderAware

    public class SortedResourcesFactoryBean

extends AbstractFactoryBean<Resource[]>
implements ResourceLoaderAware

`FactoryBean` implementation that takes a list of location Strings and creates a sorted array of `Resource` instances.

Since:
  3.0
Author:
  Dave Syer, Juergen Hoeller, Christian Dupuis

Field Summary

Fields inherited from class org.springframework.beans.factory.config.AbstractFactoryBean
`logger`

Constructor Summary
`SortedResourcesFactoryBean(List<String> locations)`
`SortedResourcesFactoryBean(ResourceLoader resourceLoader, List<String> locations)`

Method Summary
`protected Resource[]` `createInstance()` Template method that subclasses must override to construct the object returned by this factory.
`Class<? extends Resource[]>` `getObjectType()` This abstract method declaration mirrors the method in the FactoryBean interface, for a consistent offering of abstract template methods.
`void` `setResourceLoader(ResourceLoader resourceLoader)` Set the ResourceLoader that this object runs in.

Methods inherited from class org.springframework.beans.factory.config.AbstractFactoryBean
`afterPropertiesSet, destroy, destroyInstance, getBeanFactory, getBeanTypeConverter, getEarlySingletonInterfaces, getObject, isSingleton, setBeanClassLoader, setBeanFactory, setSingleton`

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Constructor Detail

### SortedResourcesFactoryBean

    public SortedResourcesFactoryBean(List<String> locations)

### SortedResourcesFactoryBean

    public SortedResourcesFactoryBean(ResourceLoader resourceLoader,
                                      List<String> locations)

Method Detail

### setResourceLoader

    public void setResourceLoader(ResourceLoader resourceLoader)

  Description copied from interface: `ResourceLoaderAware`
  Set the ResourceLoader that this object runs in.

  This might be a ResourcePatternResolver, which can be checked through `instanceof ResourcePatternResolver`. See also the `ResourcePatternUtils.getResourcePatternResolver` method.

  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`.

  Specified by:
    `setResourceLoader` in interface `ResourceLoaderAware`
  Parameters:
    `resourceLoader` - ResourceLoader object to be used by this object
  See Also:
    `ResourcePatternResolver`, `ResourcePatternUtils.getResourcePatternResolver(org.springframework.core.io.ResourceLoader)`

### getObjectType

    public Class<? extends Resource[]> getObjectType()

  Description copied from class: `AbstractFactoryBean`
  This abstract method declaration mirrors the method in the FactoryBean interface, for a consistent offering of abstract template methods.

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

### createInstance

    protected Resource[] createInstance()
                                 throws Exception

  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<Resource[]>`
  Returns:
    the object returned by this factory
  Throws:
    `Exception` - if an exception occured during object creation
  See Also:
    `AbstractFactoryBean.getObject()`