DATACMNS-90 - Polishing.

Added missing author tags where needed. Removed the template method to pick up the configuration from the RepositoryConfigurationSource interface as it's not needed from the outside.

Original pull request: #50.
This commit is contained in:
Oliver Gierke
2013-10-22 14:00:15 +02:00
parent 60534974bf
commit 1dfe235a87
6 changed files with 25 additions and 21 deletions

View File

@@ -39,6 +39,7 @@ import org.springframework.util.StringUtils;
* Annotation based {@link RepositoryConfigurationSource}.
*
* @author Oliver Gierke
* @author Thomas Darimont
*/
public class AnnotationRepositoryConfigurationSource extends RepositoryConfigurationSourceSupport {
@@ -224,11 +225,12 @@ public class AnnotationRepositoryConfigurationSource extends RepositoryConfigura
return typeFilters;
}
/* (non-Javadoc)
* @see org.springframework.data.repository.config.RepositoryConfigurationSourceSupport#isConsideringNestedRepositoriesEnabled()
/*
* (non-Javadoc)
* @see org.springframework.data.repository.config.RepositoryConfigurationSourceSupport#shouldConsiderNestedRepositories()
*/
@Override
public boolean isConsideringNestedRepositoriesEnabled() {
public boolean shouldConsiderNestedRepositories() {
return attributes.getBoolean(CONSIDER_NESTED_REPOSITORIES);
}
}

View File

@@ -77,9 +77,4 @@ public interface RepositoryConfigurationSource {
* @return
*/
Collection<String> getCandidates(ResourceLoader loader);
/**
* @return true if the container should look for nested repository interface definitions.
*/
boolean isConsideringNestedRepositoriesEnabled();
}

View File

@@ -30,6 +30,7 @@ import org.springframework.core.type.filter.TypeFilter;
* Base class to implement {@link RepositoryConfigurationSource}s.
*
* @author Oliver Gierke
* @author Thomas Darimont
*/
public abstract class RepositoryConfigurationSourceSupport implements RepositoryConfigurationSource {
@@ -54,7 +55,7 @@ public abstract class RepositoryConfigurationSourceSupport implements Repository
public Collection<String> getCandidates(ResourceLoader loader) {
RepositoryComponentProvider scanner = new RepositoryComponentProvider(getIncludeFilters());
scanner.setConsiderNestedRepositoryInterfaces(isConsideringNestedRepositoriesEnabled());
scanner.setConsiderNestedRepositoryInterfaces(shouldConsiderNestedRepositories());
scanner.setResourceLoader(loader);
scanner.setEnvironment(environment);
@@ -95,8 +96,12 @@ public abstract class RepositoryConfigurationSourceSupport implements Repository
}
/**
* Controls whether nested repository-interfaces (e.g. defined as inner classes) should be considered by the
* repository infrastructure.
* Returns whether we should consider nested repositories, i.e. repository interface definitions nested in other
* classes.
*
* @return {@literal true} if the container should look for nested repository interface definitions.
*/
public abstract boolean isConsideringNestedRepositoriesEnabled();
public boolean shouldConsiderNestedRepositories() {
return false;
}
}

View File

@@ -151,11 +151,12 @@ public class XmlRepositoryConfigurationSource extends RepositoryConfigurationSou
return StringUtils.hasText(attribute) ? attribute : null;
}
/* (non-Javadoc)
/*
* (non-Javadoc)
* @see org.springframework.data.repository.config.RepositoryConfigurationSourceSupport#isConsideringNestedRepositoriesEnabled()
*/
@Override
public boolean isConsideringNestedRepositoriesEnabled() {
public boolean shouldConsiderNestedRepositories() {
String attribute = getNullDefaultedAttribute(element, CONSIDER_NESTED_REPOSITORIES);
return attribute != null && Boolean.parseBoolean(attribute);