Introduce TypeHint.Builder#onReachableType(Class<?>)

Closes gh-29017
This commit is contained in:
Sébastien Deleuze
2022-08-26 08:30:25 +02:00
parent 7671d29899
commit 08f636b691
6 changed files with 17 additions and 8 deletions

View File

@@ -38,7 +38,7 @@ import org.springframework.lang.Nullable;
class CodecConfigurerRuntimeHints implements RuntimeHintsRegistrar {
private static final Consumer<Builder> CODEC_HINT = type -> type
.onReachableType(TypeReference.of(CodecConfigurerFactory.class))
.onReachableType(CodecConfigurerFactory.class)
.withMembers(MemberCategory.INVOKE_PUBLIC_CONSTRUCTORS);
@Override

View File

@@ -22,7 +22,6 @@ import org.springframework.aot.hint.MemberCategory;
import org.springframework.aot.hint.RuntimeHints;
import org.springframework.aot.hint.RuntimeHintsRegistrar;
import org.springframework.aot.hint.TypeHint.Builder;
import org.springframework.aot.hint.TypeReference;
/**
* {@link RuntimeHintsRegistrar} implementation that registers reflection entries
@@ -35,7 +34,7 @@ import org.springframework.aot.hint.TypeReference;
class JacksonModulesRuntimeHints implements RuntimeHintsRegistrar {
private static final Consumer<Builder> asJacksonModule = builder ->
builder.onReachableType(TypeReference.of(Jackson2ObjectMapperBuilder.class))
builder.onReachableType(Jackson2ObjectMapperBuilder.class)
.withMembers(MemberCategory.INVOKE_DECLARED_CONSTRUCTORS);
@Override