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:
@@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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();
|
||||
}
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user