org.springframework.data.repository.init

## Class ResourceReaderRepositoryPopulator

- java.lang.Object
- - org.springframework.data.repository.init.ResourceReaderRepositoryPopulator

All Implemented Interfaces:
  Aware, ApplicationEventPublisherAware, RepositoryPopulator

    public class ResourceReaderRepositoryPopulator
    extends Object
    implements RepositoryPopulator, ApplicationEventPublisherAware

A `RepositoryPopulator` using a `ResourceReader` to read objects from the configured `Resource`s.

Since:
  1.4
Author:
  Oliver Gierke, Christoph Strobl

### Constructor Summary

Constructors
Constructor and Description
`ResourceReaderRepositoryPopulator(ResourceReader reader)` Creates a new `ResourceReaderRepositoryPopulator` using the given `ResourceReader`.
`ResourceReaderRepositoryPopulator(ResourceReader reader, ClassLoader classLoader)` Creates a new `ResourceReaderRepositoryPopulator` using the given `ResourceReader` and `ClassLoader`.

### Method Summary

All Methods Instance Methods Concrete Methods
`void` `populate(Repositories repositories)` Populates the given `Repositories`.
`void` `setApplicationEventPublisher(ApplicationEventPublisher publisher)`
`void` `setResourceLocation(String location)` Configures the location of the `Resource`s to be used to initialize the repositories.
`void` `setResources(Resource... resources)` Configures the `Resource`s to be used to initialize the repositories.

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

### Constructor Detail

#### ResourceReaderRepositoryPopulator

    public ResourceReaderRepositoryPopulator(ResourceReader reader)

Creates a new `ResourceReaderRepositoryPopulator` using the given `ResourceReader`.

Parameters:
  `reader` - must not be null.

#### ResourceReaderRepositoryPopulator

    public ResourceReaderRepositoryPopulator(ResourceReader reader,
                                             @Nullable
                                             ClassLoader classLoader)

Creates a new `ResourceReaderRepositoryPopulator` using the given `ResourceReader` and `ClassLoader`.

Parameters:
  `reader` - must not be null.
  `classLoader` - can be null.

### Method Detail

#### setResourceLocation

    public void setResourceLocation(String location)
                             throws IOException

Configures the location of the `Resource`s to be used to initialize the repositories.

Parameters:
  `location` - must not be null or empty.
Throws:
  `IOException`

#### setResources

    public void setResources(Resource... resources)

Configures the `Resource`s to be used to initialize the repositories.

Parameters:
  `resources` -

#### setApplicationEventPublisher

    public void setApplicationEventPublisher(ApplicationEventPublisher publisher)

Specified by:
  `setApplicationEventPublisher` in interface `ApplicationEventPublisherAware`

#### populate

    public void populate(Repositories repositories)

Description copied from interface: `RepositoryPopulator`
Populates the given `Repositories`.

Specified by:
  `populate` in interface `RepositoryPopulator`
Parameters:
  `repositories` - must not be null.