Class FlagSerializerBeans

java.lang.Object
org.openrewrite.Recipe
org.axonframework.migration.FlagSerializerBeans
All Implemented Interfaces:
Cloneable

public class FlagSerializerBeans extends org.openrewrite.Recipe
Flags Spring @Bean methods that register an Axon Framework 4 Serializer with a // TODO(axon4to5): comment.

AF5 replaced the Serializer API with the Converter API, so such a bean no longer compiles. A Serializer cannot be swapped for a Converter mechanically (for example, XStreamSerializer has no replacement), hence the comment points to the serializer migration path instead of rewriting the bean.

A method is flagged when it is annotated with @Bean and its declared return type is assignable to the AF4 org.axonframework.serialization.Serializer or to the same type after the package rename to org.axonframework.conversion. The latter keeps the recipe working regardless of whether it runs before or after the package rename. Serializers of other libraries, such as Jackson's JsonSerializer or Kafka's Serializer, are never flagged. Only when the return type could not be resolved at all does the recipe fall back to the simple name Serializer.

Since:
5.5.0
Author:
Steven van Beelen
  • Nested Class Summary

    Nested classes/interfaces inherited from class org.openrewrite.Recipe

    org.openrewrite.Recipe.Builder, org.openrewrite.Recipe.DelegatingRecipe
  • Field Summary

    Fields inherited from class org.openrewrite.Recipe

    contributors, examples, PANIC
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
     
     
    org.openrewrite.TreeVisitor<?,org.openrewrite.ExecutionContext>
     

    Methods inherited from class org.openrewrite.Recipe

    addDataTable, aggregateDataTableDescriptors, builder, buildRecipeList, causesAnotherCycle, clone, createRecipeDescriptor, equals, getContributors, getDataTableDescriptors, getDescriptor, getEstimatedEffortPerOccurrence, getExamples, getInstanceName, getInstanceNameSuffix, getJacksonPolymorphicTypeTag, getMaintainers, getName, getRecipeList, getTags, hashCode, maxCycles, noop, onComplete, run, run, run, setContributors, setExamples, validate, validate, validateAll, validateAll, withOptions

    Methods inherited from class java.lang.Object

    finalize, getClass, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • FlagSerializerBeans

      public FlagSerializerBeans()
  • Method Details

    • getDisplayName

      public String getDisplayName()
      Specified by:
      getDisplayName in class org.openrewrite.Recipe
    • getDescription

      public String getDescription()
      Specified by:
      getDescription in class org.openrewrite.Recipe
    • getVisitor

      public org.openrewrite.TreeVisitor<?,org.openrewrite.ExecutionContext> getVisitor()
      Overrides:
      getVisitor in class org.openrewrite.Recipe