Spring Data Commons

org.springframework.data.repository.init
Class ResourceReaderRepositoryPopulator

java.lang.Object
  extended by org.springframework.data.repository.init.ResourceReaderRepositoryPopulator
All Implemented Interfaces:
RepositoryPopulator

public class ResourceReaderRepositoryPopulator
extends Object
implements RepositoryPopulator

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

Since:
1.4
Author:
Oliver Gierke

Constructor Summary
ResourceReaderRepositoryPopulator(ResourceReader reader)
          Creates a new ResourceReaderRepositoryPopulator using the given ResourceReader.
ResourceReaderRepositoryPopulator(ResourceReader resourceReader, ClassLoader classLoader)
          Createsa a new ResourceReaderRepositoryPopulator using the given ResourceReader and ClassLoader.
 
Method Summary
 void populate(Repositories repositories)
          Populates the given Repositories.
 void setResourceLocation(String location)
          Configures the location of the Resources to be used to initialize the repositories.
 void setResources(Resource... resources)
          Configures the Resources 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 resourceReader,
                                         ClassLoader classLoader)
Createsa a new ResourceReaderRepositoryPopulator using the given ResourceReader and ClassLoader.

Parameters:
reader - must not be null.
classLoader -
Method Detail

setResourceLocation

public void setResourceLocation(String location)
                         throws IOException
Configures the location of the Resources 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 Resources to be used to initialize the repositories.

Parameters:
resources -

populate

public void populate(Repositories repositories)
Description copied from interface: RepositoryPopulator
Populates the given Repositories.

Specified by:
populate in interface RepositoryPopulator

Spring Data Commons

Copyright © 2012. All Rights Reserved.