Class SpinJackson2DataFormatCondition

java.lang.Object
org.camunda.bpm.spring.boot.starter.spin.SpinJackson2DataFormatCondition
All Implemented Interfaces:
org.springframework.context.annotation.Condition

public class SpinJackson2DataFormatCondition extends Object implements org.springframework.context.annotation.Condition
Matches only when the Spin JSON data format on the classpath is the Jackson 2 variant.

The CamundaJacksonFormatConfigurator* beans are compiled against Jackson 2 and call JacksonJsonDataFormat#getObjectMapper(). Against the Jackson 3 Spin variant — which publishes the same class name but returns a tools.jackson.databind.ObjectMapper — that call raises a NoSuchMethodError during engine bootstrap. This condition keeps the beans from being created in the first place, which is the correct behaviour: Jackson 3 has java.time, Jdk8 and parameter-names support built into tools.jackson.databind, so there is nothing left for the configurators to register.

See SpinJacksonSupport for why the discriminator is the getObjectMapper() return type and not a class-presence check.

This condition is ANDed with the pre-existing @ConditionalOnMissingClass("spinjar.com.fasterxml.jackson.databind.ObjectMapper"), so it can never enable a bean that is disabled today — the only configuration whose behaviour changes is the plain Jackson 3 Spin swap, which currently fails to start at all.

  • Constructor Details

    • SpinJackson2DataFormatCondition

      public SpinJackson2DataFormatCondition()
  • Method Details

    • matches

      public boolean matches(org.springframework.context.annotation.ConditionContext context, org.springframework.core.type.AnnotatedTypeMetadata metadata)
      Specified by:
      matches in interface org.springframework.context.annotation.Condition