Class SpinJacksonSupport
Both variants ship the same fully qualified class name
org.camunda.spin.impl.json.jackson.format.JacksonJsonDataFormat — the Jackson 3 module
is generated from the Jackson 2 sources by the Eclipse Transformer. They differ only in the
return type of getObjectMapper():
com.fasterxml.jackson.databind.ObjectMapper vs. tools.jackson.databind.ObjectMapper.
That makes the return type the only precise discriminator. In particular it cannot be done by
checking whether tools.jackson.databind.ObjectMapper is on the classpath: Spring Boot 4
ships Jackson 3 itself (spring-boot-starter-web → spring-boot-starter-jackson →
spring-boot-jackson → tools.jackson.core:jackson-databind), so that class is present for
virtually every user, including those running the default Jackson 2 Spin stack.
It also cannot be done with an instanceof inside
CamundaJacksonFormatConfigurator*#configure(...): the JVM resolves methods by name
and full descriptor including return type, so the Jackson-2-compiled
getObjectMapper() call site raises a NoSuchMethodError against the Jackson 3
variant before any instanceof could run. The probe has to happen before the call.
-
Method Summary
Modifier and TypeMethodDescriptionstatic booleanhasJackson2ObjectMapper(Class<?> dataFormatClass) static booleanhasJackson2SpinDataFormat(ClassLoader classLoader)
-
Method Details
-
hasJackson2ObjectMapper
- Returns:
trueif the given class exposes agetObjectMapper()returning a Jackson 2ObjectMapper, i.e. if it is the Jackson 2 Spin JSON data format.
-
hasJackson2SpinDataFormat
- Returns:
trueif the Spin JSON data format visible to the given class loader is the Jackson 2 variant.falseif it is the Jackson 3 variant or absent entirely.
-