Class WorkflowObjectMapperFactory

java.lang.Object
ai.mindconnect.workflow.jackson.WorkflowObjectMapperFactory

public class WorkflowObjectMapperFactory extends Object
Produces a Jackson ObjectMapper pre-configured for workflow serialization/deserialization.

Design

All Jackson annotations (@JsonTypeInfo, @JsonIgnore, etc.) are applied via mixins rather than on the domain classes themselves. This keeps mc-workflow-api completely free of Jackson.

Polymorphism strategy

StepData uses @JsonTypeInfo(use = Id.CLASS) so that the full class name is stored as "@class" in JSON. This requires no central registry of subtypes and supports custom steps automatically — any class on the classpath can be deserialized as long as it extends StepData.

Usage:


 ObjectMapper mapper = WorkflowObjectMapperFactory.create();
 
  • Method Summary

    Modifier and Type
    Method
    Description
    static com.fasterxml.jackson.databind.ObjectMapper
    Creates a new ObjectMapper with all workflow mixins registered and pretty-printing enabled.
    static void
    registerMixins(com.fasterxml.jackson.databind.ObjectMapper mapper)
    Registers workflow mixins on an existing mapper.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Method Details

    • create

      public static com.fasterxml.jackson.databind.ObjectMapper create()
      Creates a new ObjectMapper with all workflow mixins registered and pretty-printing enabled.
    • registerMixins

      public static void registerMixins(com.fasterxml.jackson.databind.ObjectMapper mapper)
      Registers workflow mixins on an existing mapper. Use this when you want to combine the workflow configuration with your own mapper settings (e.g. date formats, modules, naming strategies).