diff --git a/src/main/java/org/springframework/data/aot/ManagedTypesBeanRegistrationAotProcessor.java b/src/main/java/org/springframework/data/aot/ManagedTypesBeanRegistrationAotProcessor.java index e08450880..f3a99e17a 100644 --- a/src/main/java/org/springframework/data/aot/ManagedTypesBeanRegistrationAotProcessor.java +++ b/src/main/java/org/springframework/data/aot/ManagedTypesBeanRegistrationAotProcessor.java @@ -135,6 +135,7 @@ public class ManagedTypesBeanRegistrationAotProcessor implements BeanRegistratio * Customization hook to configure {@link TypeCollector}. * * @return a {@link Consumer} to customize the {@link TypeCollector}, must not be {@literal null}. + * @since 4.0 */ protected Consumer typeCollectorCustomizer() { return typeCollector -> {}; @@ -168,6 +169,7 @@ public class ManagedTypesBeanRegistrationAotProcessor implements BeanRegistratio * * @param type the class to configure the contribution for. * @param aotContext AOT context for type configuration. + * @since 4.0 */ protected void configureTypeContribution(Class type, AotContext aotContext) { aotContext.typeConfiguration(type, config -> config.forDataBinding().contributeAccessors().forQuerydsl()); diff --git a/src/main/java/org/springframework/data/util/Predicates.java b/src/main/java/org/springframework/data/util/Predicates.java index 82ef0742e..e22bce52f 100644 --- a/src/main/java/org/springframework/data/util/Predicates.java +++ b/src/main/java/org/springframework/data/util/Predicates.java @@ -33,11 +33,9 @@ import org.springframework.util.Assert; public interface Predicates { Predicate IS_ENUM_MEMBER = member -> member.getDeclaringClass().isEnum(); - Predicate IS_HIBERNATE_MEMBER = member -> member.getName().startsWith("$$_hibernate"); // this - // should - // go - // into - // JPA + + @Deprecated(since = "4.0", forRemoval = true) + Predicate IS_HIBERNATE_MEMBER = member -> member.getName().startsWith("$$_hibernate"); Predicate IS_OBJECT_MEMBER = member -> Object.class.equals(member.getDeclaringClass()); Predicate IS_JAVA = member -> member.getDeclaringClass().getPackageName().startsWith("java."); Predicate IS_NATIVE = member -> Modifier.isNative(member.getModifiers()); diff --git a/src/main/java/org/springframework/data/util/TypeCollector.java b/src/main/java/org/springframework/data/util/TypeCollector.java index 28ec42b9f..2e5f55b32 100644 --- a/src/main/java/org/springframework/data/util/TypeCollector.java +++ b/src/main/java/org/springframework/data/util/TypeCollector.java @@ -52,7 +52,7 @@ import org.springframework.util.ReflectionUtils; * that returns {@code false}. Filters are {@link Predicate#and(Predicate) combined} so that multiple filters can be * taken into account. A type/field/method must pass all filters to be considered for further inspection. *

- * The collector uses {@link AotServices} to discover implementations of {@link TypeCollectorPredicateProvider} so that + * The collector uses {@link AotServices} to discover implementations of {@link TypeCollectorFilters} so that * components using {@link TypeCollector} can contribute their own filtering logic to exclude types, fields, and methods * from being inspected. * @@ -66,8 +66,8 @@ public class TypeCollector { private static final Log logger = LogFactory.getLog(TypeCollector.class); - private static final AotServices providers = AotServices.factories() - .load(TypeCollectorPredicateProvider.class); + private static final AotServices providers = AotServices.factories() + .load(TypeCollectorFilters.class); private Predicate> typeFilter = Predicates.isTrue(); @@ -76,7 +76,7 @@ public class TypeCollector { private Predicate fieldFilter = Predicates.isTrue(); /** - * Create a new {@link TypeCollector} applying all {@link TypeCollectorPredicateProvider} discovered through + * Create a new {@link TypeCollector} applying all {@link TypeCollectorFilters} discovered through * {@link AotServices}. */ public TypeCollector() { @@ -105,6 +105,7 @@ public class TypeCollector { * * @param filter filter predicate matching a {@link Class}. * @return {@code this} TypeCollector instance. + * @since 4.0 */ @Contract("_ -> this") public TypeCollector filterMethods(Predicate filter) { @@ -117,6 +118,7 @@ public class TypeCollector { * * @param filter filter predicate matching a {@link Class}. * @return {@code this} TypeCollector instance. + * @since 4.0 */ @Contract("_ -> this") public TypeCollector filterFields(Predicate filter) { @@ -351,7 +353,7 @@ public class TypeCollector { * @author Mark Paluch * @since 4.0 */ - public interface TypeCollectorPredicateProvider { + public interface TypeCollectorFilters { /** * Return a predicate to filter types. @@ -383,12 +385,12 @@ public class TypeCollector { } /** - * Default implementation of {@link TypeCollectorPredicateProvider} that excludes types from certain packages and + * Default implementation of {@link TypeCollectorFilters} that excludes types from certain packages and * filters out unwanted fields and methods. * * @since 4.0 */ - private static class DefaultTypeCollectorPredicateProvider implements TypeCollectorPredicateProvider { + private static class DefaultTypeCollectorFilters implements TypeCollectorFilters { private static final Set EXCLUDED_DOMAINS = Set.of("java", "sun.", "jdk.", "reactor.", "kotlinx.", "kotlin.", "org.springframework.core.", "org.springframework.data.mapping.", diff --git a/src/main/resources/META-INF/spring/aot.factories b/src/main/resources/META-INF/spring/aot.factories index 67e890a84..977f848a8 100644 --- a/src/main/resources/META-INF/spring/aot.factories +++ b/src/main/resources/META-INF/spring/aot.factories @@ -8,5 +8,6 @@ org.springframework.aot.hint.RuntimeHintsRegistrar=\ org.springframework.beans.factory.aot.BeanRegistrationAotProcessor=\ org.springframework.data.aot.AuditingBeanRegistrationAotProcessor -org.springframework.data.util.TypeCollector$TypeCollectorPredicateProvider=\ - org.springframework.data.util.TypeCollector$DefaultTypeCollectorPredicateProvider + +org.springframework.data.util.TypeCollector$TypeCollectorFilters=\ + org.springframework.data.util.TypeCollector$DefaultTypeCollectorFilters