|
|
|
|
@ -326,19 +326,15 @@ public class JacksonAutoConfiguration {
@@ -326,19 +326,15 @@ public class JacksonAutoConfiguration {
|
|
|
|
|
|
|
|
|
|
private void configureConstructorDetector(Jackson2ObjectMapperBuilder builder) { |
|
|
|
|
ConstructorDetectorStrategy strategy = this.jacksonProperties.getConstructorDetector(); |
|
|
|
|
if (strategy != null) { |
|
|
|
|
builder.postConfigurer((objectMapper) -> { |
|
|
|
|
switch (strategy) { |
|
|
|
|
case USE_PROPERTIES_BASED -> |
|
|
|
|
objectMapper.setConstructorDetector(ConstructorDetector.USE_PROPERTIES_BASED); |
|
|
|
|
case USE_DELEGATING -> |
|
|
|
|
objectMapper.setConstructorDetector(ConstructorDetector.USE_DELEGATING); |
|
|
|
|
case EXPLICIT_ONLY -> |
|
|
|
|
objectMapper.setConstructorDetector(ConstructorDetector.EXPLICIT_ONLY); |
|
|
|
|
default -> objectMapper.setConstructorDetector(ConstructorDetector.DEFAULT); |
|
|
|
|
} |
|
|
|
|
}); |
|
|
|
|
} |
|
|
|
|
builder.postConfigurer((objectMapper) -> { |
|
|
|
|
switch (strategy) { |
|
|
|
|
case USE_PROPERTIES_BASED -> |
|
|
|
|
objectMapper.setConstructorDetector(ConstructorDetector.USE_PROPERTIES_BASED); |
|
|
|
|
case USE_DELEGATING -> objectMapper.setConstructorDetector(ConstructorDetector.USE_DELEGATING); |
|
|
|
|
case EXPLICIT_ONLY -> objectMapper.setConstructorDetector(ConstructorDetector.EXPLICIT_ONLY); |
|
|
|
|
default -> objectMapper.setConstructorDetector(ConstructorDetector.DEFAULT); |
|
|
|
|
} |
|
|
|
|
}); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
|