Package ai.mindconnect.workflow.jackson
Class WorkflowObjectMapperFactory
java.lang.Object
ai.mindconnect.workflow.jackson.WorkflowObjectMapperFactory
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 TypeMethodDescriptionstatic com.fasterxml.jackson.databind.ObjectMappercreate()Creates a newObjectMapperwith all workflow mixins registered and pretty-printing enabled.static voidregisterMixins(com.fasterxml.jackson.databind.ObjectMapper mapper) Registers workflow mixins on an existing mapper.
-
Method Details
-
create
public static com.fasterxml.jackson.databind.ObjectMapper create()Creates a newObjectMapperwith 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).
-