mirror of
https://github.com/spring-projects/spring-data-commons.git
synced 2026-05-02 19:22:27 +01:00
DATACMNS-1097 - Polishing.
Updated Sonargraph architecture description. Polished imports in domain package to avoid unnecessary imports (mostly due to Javadoc references). Removed manually declared constructor in ExampleMatcherAccessor in favor of Lombok's @RequiredArgsConstructor. Removed deprecations in type information subsystem. Moved to different way of class loading to avoid null pointer warnings in ReflectionUtils.
This commit is contained in:
@@ -57,6 +57,7 @@
|
||||
<element type="IncludeTypePattern" name="**.core.support.**"/>
|
||||
</element>
|
||||
<dependency toName="Project|spring-data-commons::Layer|Application::Subsystem|Domain" type="AllowedDependency"/>
|
||||
<dependency toName="Project|spring-data-commons::Layer|Application::Subsystem|Support" type="AllowedDependency"/>
|
||||
<dependency toName="Project|spring-data-commons::Layer|Repositories::Subsystem|Core" type="AllowedDependency"/>
|
||||
<dependency toName="Project|spring-data-commons::Layer|Repositories::Subsystem|Query" type="AllowedDependency"/>
|
||||
</element>
|
||||
@@ -84,6 +85,7 @@
|
||||
<element type="TypeFilter" name="Assignment">
|
||||
<element type="IncludeTypePattern" name="**.cdi.**"/>
|
||||
</element>
|
||||
<dependency toName="External|External::Subsystem|JRE" type="AllowedDependency"/>
|
||||
<dependency toName="External|External::Subsystem|JavaEE" type="AllowedDependency"/>
|
||||
<dependency toName="External|External::Subsystem|Logging" type="AllowedDependency"/>
|
||||
<dependency toName="External|External::Subsystem|Reflection" type="AllowedDependency"/>
|
||||
@@ -142,61 +144,11 @@
|
||||
<element type="TypeFilter" name="Assignment">
|
||||
<element type="IncludeTypePattern" name="**.context.**"/>
|
||||
</element>
|
||||
<dependency toName="Project|spring-data-commons::Layer|Application::Subsystem|Support" type="AllowedDependency"/>
|
||||
<dependency toName="Project|spring-data-commons::Layer|Mapping::Subsystem|Model" type="AllowedDependency"/>
|
||||
</element>
|
||||
<dependency toName="Project|spring-data-commons::Layer|Core" type="AllowedDependency"/>
|
||||
</element>
|
||||
<element type="Layer" name="Core">
|
||||
<element type="TypeFilter" name="Assignment"/>
|
||||
<element type="Subsystem" name="Types">
|
||||
<element type="TypeFilter" name="Assignment">
|
||||
<element type="WeakTypePattern" name="**.util.**"/>
|
||||
</element>
|
||||
<stereotype name="Public"/>
|
||||
</element>
|
||||
<element type="Subsystem" name="Annotations">
|
||||
<element type="TypeFilter" name="Assignment">
|
||||
<element type="IncludeTypePattern" name="**.annotation.**"/>
|
||||
</element>
|
||||
<stereotype name="Public"/>
|
||||
</element>
|
||||
<element type="Subsystem" name="Geo">
|
||||
<element type="TypeFilter" name="Assignment">
|
||||
<element type="IncludeTypePattern" name="**.geo.**"/>
|
||||
</element>
|
||||
</element>
|
||||
<element type="Subsystem" name="Authentication">
|
||||
<element type="TypeFilter" name="Assignment">
|
||||
<element type="IncludeTypePattern" name="**.authentication.**"/>
|
||||
</element>
|
||||
</element>
|
||||
<element type="Subsystem" name="History">
|
||||
<element type="TypeFilter" name="Assignment">
|
||||
<element type="WeakTypePattern" name="**.history.**"/>
|
||||
</element>
|
||||
</element>
|
||||
<element type="Subsystem" name="Support">
|
||||
<element type="TypeFilter" name="Assignment">
|
||||
<element type="WeakTypePattern" name="**.support.**"/>
|
||||
</element>
|
||||
</element>
|
||||
<element type="Subsystem" name="Transactions">
|
||||
<element type="TypeFilter" name="Assignment">
|
||||
<element type="IncludeTypePattern" name="**.transaction.**"/>
|
||||
</element>
|
||||
</element>
|
||||
<element type="Subsystem" name="Configuration">
|
||||
<element type="TypeFilter" name="Assignment">
|
||||
<element type="WeakTypePattern" name="**.config.**"/>
|
||||
</element>
|
||||
</element>
|
||||
<element type="Subsystem" name="Projection">
|
||||
<element type="TypeFilter" name="Assignment">
|
||||
<element type="IncludeTypePattern" name="**.projection.**"/>
|
||||
</element>
|
||||
</element>
|
||||
<dependency toName="Project|spring-data-commons::Layer|Application" type="AllowedDependency"/>
|
||||
</element>
|
||||
<element type="Layer" name="Application">
|
||||
<element type="TypeFilter" name="Assignment"/>
|
||||
<element type="Subsystem" name="Domain">
|
||||
@@ -217,6 +169,68 @@
|
||||
<element type="IncludeTypePattern" name="**.crossstore.**"/>
|
||||
</element>
|
||||
</element>
|
||||
<element type="Subsystem" name="Geo">
|
||||
<element type="TypeFilter" name="Assignment">
|
||||
<element type="IncludeTypePattern" name="**.geo.**"/>
|
||||
</element>
|
||||
<dependency toName="Project|spring-data-commons::Layer|Application::Subsystem|Domain" type="AllowedDependency"/>
|
||||
</element>
|
||||
<element type="Subsystem" name="History">
|
||||
<element type="TypeFilter" name="Assignment">
|
||||
<element type="WeakTypePattern" name="**.history.**"/>
|
||||
</element>
|
||||
<dependency toName="Project|spring-data-commons::Layer|Application::Subsystem|Domain" type="AllowedDependency"/>
|
||||
</element>
|
||||
<element type="Subsystem" name="Support">
|
||||
<element type="TypeFilter" name="Assignment">
|
||||
<element type="WeakTypePattern" name="**.support.**"/>
|
||||
</element>
|
||||
<dependency toName="Project|spring-data-commons::Layer|Application::Subsystem|Domain" type="AllowedDependency"/>
|
||||
</element>
|
||||
<dependency toName="Project|spring-data-commons::Layer|Core" type="AllowedDependency"/>
|
||||
</element>
|
||||
<element type="Layer" name="Core">
|
||||
<element type="TypeFilter" name="Assignment"/>
|
||||
<element type="Subsystem" name="Types">
|
||||
<element type="TypeFilter" name="Assignment">
|
||||
<element type="WeakTypePattern" name="**.util.**Information"/>
|
||||
<element type="IncludeTypePattern" name="**.util.TypeDiscoverer**"/>
|
||||
</element>
|
||||
<stereotype name="Public"/>
|
||||
<dependency toName="Project|spring-data-commons::Layer|Core::Subsystem|Util" type="AllowedDependency"/>
|
||||
</element>
|
||||
<element type="Subsystem" name="Util">
|
||||
<element type="TypeFilter" name="Assignment">
|
||||
<element type="WeakTypePattern" name="**.util.**"/>
|
||||
</element>
|
||||
</element>
|
||||
<element type="Subsystem" name="Annotations">
|
||||
<element type="TypeFilter" name="Assignment">
|
||||
<element type="IncludeTypePattern" name="**.annotation.**"/>
|
||||
</element>
|
||||
<stereotype name="Public"/>
|
||||
</element>
|
||||
<element type="Subsystem" name="Authentication">
|
||||
<element type="TypeFilter" name="Assignment">
|
||||
<element type="IncludeTypePattern" name="**.authentication.**"/>
|
||||
</element>
|
||||
</element>
|
||||
<element type="Subsystem" name="Transactions">
|
||||
<element type="TypeFilter" name="Assignment">
|
||||
<element type="IncludeTypePattern" name="**.transaction.**"/>
|
||||
</element>
|
||||
</element>
|
||||
<element type="Subsystem" name="Configuration">
|
||||
<element type="TypeFilter" name="Assignment">
|
||||
<element type="WeakTypePattern" name="**.config.**"/>
|
||||
</element>
|
||||
</element>
|
||||
<element type="Subsystem" name="Projection">
|
||||
<element type="TypeFilter" name="Assignment">
|
||||
<element type="IncludeTypePattern" name="**.projection.**"/>
|
||||
</element>
|
||||
<dependency toName="Project|spring-data-commons::Layer|Core::Subsystem|Util" type="AllowedDependency"/>
|
||||
</element>
|
||||
</element>
|
||||
</architecture>
|
||||
<workspace>
|
||||
@@ -348,6 +362,16 @@
|
||||
<element type="IncludeTypePattern" name="org.threeten.bp.**"/>
|
||||
</element>
|
||||
</element>
|
||||
<element type="Subsystem" name="Vavr">
|
||||
<element type="TypeFilter" name="Assignment">
|
||||
<element type="IncludeTypePattern" name="io.vavr.**"/>
|
||||
</element>
|
||||
</element>
|
||||
<element type="Subsystem" name="Lombok">
|
||||
<element type="TypeFilter" name="Assignment">
|
||||
<element type="IncludeTypePattern" name="lombok.**"/>
|
||||
</element>
|
||||
</element>
|
||||
</architecture>
|
||||
</scope>
|
||||
<scope type="Global" name="Global">
|
||||
|
||||
@@ -20,14 +20,12 @@ import java.lang.annotation.Retention;
|
||||
import java.lang.annotation.RetentionPolicy;
|
||||
import java.lang.annotation.Target;
|
||||
|
||||
import org.springframework.context.ApplicationEventPublisher;
|
||||
|
||||
/**
|
||||
* {@link DomainEvents} can be used on methods of aggregate roots managed by Spring Data repositories to publish the
|
||||
* events returned by that method as Spring application events.
|
||||
*
|
||||
* @author Oliver Gierke
|
||||
* @see ApplicationEventPublisher
|
||||
* @see org.springframework.context.ApplicationEventPublisher
|
||||
* @see AfterDomainEventPublication
|
||||
* @since 1.13
|
||||
* @soundtrack Benny Greb - Soulfood (Moving Parts Live)
|
||||
|
||||
@@ -17,8 +17,6 @@ package org.springframework.data.domain;
|
||||
|
||||
import java.util.function.Function;
|
||||
|
||||
import org.springframework.core.convert.converter.Converter;
|
||||
|
||||
/**
|
||||
* A page is a sublist of a list of objects. It allows gain information about the position of it in the containing
|
||||
* entire list.
|
||||
@@ -43,10 +41,10 @@ public interface Page<T> extends Slice<T> {
|
||||
long getTotalElements();
|
||||
|
||||
/**
|
||||
* Returns a new {@link Page} with the content of the current one mapped by the given {@link Converter}.
|
||||
* Returns a new {@link Page} with the content of the current one mapped by the given {@link Function}.
|
||||
*
|
||||
* @param converter must not be {@literal null}.
|
||||
* @return a new {@link Page} with the content of the current one mapped by the given {@link Converter}.
|
||||
* @return a new {@link Page} with the content of the current one mapped by the given {@link Function}.
|
||||
* @since 1.10
|
||||
*/
|
||||
<U> Page<U> map(Function<? super T, ? extends U> converter);
|
||||
|
||||
@@ -15,12 +15,13 @@
|
||||
*/
|
||||
package org.springframework.data.support;
|
||||
|
||||
import lombok.NonNull;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
|
||||
import java.util.Collection;
|
||||
|
||||
import org.springframework.data.domain.ExampleMatcher;
|
||||
import org.springframework.data.domain.ExampleMatcher.PropertySpecifier;
|
||||
import org.springframework.data.util.StringMatcher;
|
||||
import org.springframework.util.Assert;
|
||||
|
||||
/**
|
||||
* Accessor for the {@link ExampleMatcher} to use in modules that support query by example (QBE) querying.
|
||||
@@ -31,21 +32,10 @@ import org.springframework.util.Assert;
|
||||
* @author Jens Schauder
|
||||
* @since 1.12
|
||||
*/
|
||||
@RequiredArgsConstructor
|
||||
public class ExampleMatcherAccessor {
|
||||
|
||||
private final ExampleMatcher matcher;
|
||||
|
||||
/**
|
||||
* Creates a new {@link ExampleMatcherAccessor} for the given {@link ExampleMatcher}.
|
||||
*
|
||||
* @param matcher must not be {@literal null}.
|
||||
*/
|
||||
public ExampleMatcherAccessor(ExampleMatcher matcher) {
|
||||
|
||||
Assert.notNull(matcher, "ExampleMatcher must not be null!");
|
||||
|
||||
this.matcher = matcher;
|
||||
}
|
||||
private final @NonNull ExampleMatcher matcher;
|
||||
|
||||
/**
|
||||
* Returns the {@link PropertySpecifier}s of the underlying {@link ExampleMatcher}.
|
||||
|
||||
@@ -117,7 +117,6 @@ public class ClassTypeInformation<S> extends TypeDiscoverer<S> {
|
||||
return getTypeVariableMap(type, new HashSet<>());
|
||||
}
|
||||
|
||||
@SuppressWarnings("deprecation")
|
||||
private static Map<TypeVariable<?>, Type> getTypeVariableMap(Class<?> type, Collection<Type> visited) {
|
||||
|
||||
if (visited.contains(type)) {
|
||||
|
||||
@@ -60,7 +60,7 @@ public class ReflectionUtils {
|
||||
public static <T> T createInstanceIfPresent(String classname, T defaultInstance) {
|
||||
|
||||
try {
|
||||
Class<?> type = ClassUtils.getDefaultClassLoader().loadClass(classname);
|
||||
Class<?> type = ClassUtils.forName(classname, ClassUtils.getDefaultClassLoader());
|
||||
return (T) BeanUtils.instantiateClass(type);
|
||||
} catch (Exception e) {
|
||||
return defaultInstance;
|
||||
|
||||
@@ -115,7 +115,7 @@ class TypeDiscoverer<S> implements TypeInformation<S> {
|
||||
* @param fieldType must not be {@literal null}.
|
||||
* @return
|
||||
*/
|
||||
@SuppressWarnings({ "rawtypes", "unchecked", "deprecation" })
|
||||
@SuppressWarnings({ "rawtypes", "unchecked" })
|
||||
protected TypeInformation<?> createInfo(Type fieldType) {
|
||||
|
||||
Assert.notNull(fieldType, "Field type must not be null!");
|
||||
@@ -180,7 +180,7 @@ class TypeDiscoverer<S> implements TypeInformation<S> {
|
||||
* @param type
|
||||
* @return
|
||||
*/
|
||||
@SuppressWarnings({ "unchecked", "rawtypes", "deprecation" })
|
||||
@SuppressWarnings({ "unchecked", "rawtypes" })
|
||||
protected Class<S> resolveType(Type type) {
|
||||
|
||||
Map<TypeVariable, Type> map = new HashMap<>();
|
||||
|
||||
Reference in New Issue
Block a user