Class AddEventAnnotation

java.lang.Object
org.openrewrite.Recipe
org.openrewrite.ScanningRecipe<AddEventAnnotation.Accumulator>
org.axonframework.migration.AddEventAnnotation
All Implemented Interfaces:
Cloneable

public class AddEventAnnotation extends org.openrewrite.ScanningRecipe<AddEventAnnotation.Accumulator>
Scans for methods annotated with @EventSourcingHandler and annotates their event payload types with @Event.

If the event class carried an AF4 @Revision("x") annotation, it is removed and the version is forwarded into @Event(version = "x"), preserving the serialization contract. Event classes without @Revision receive a bare @Event (defaults to version = "0.0.1" per the AF5 specification).

Both AF4 (org.axonframework.eventsourcing.EventSourcingHandler) and AF5 (org.axonframework.eventsourcing.annotation.EventSourcingHandler) FQNs are matched so the recipe is safe to run before or after Axon4ToAxon5EventSourcing.

Since:
5.1.1
Author:
Mateusz Nowak
  • Nested Class Summary

    Nested Classes
    Modifier and Type
    Class
    Description
    static class 
     

    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
     
     
    getInitialValue(org.openrewrite.ExecutionContext ctx)
     
    org.openrewrite.TreeVisitor<?,org.openrewrite.ExecutionContext>
     
    org.openrewrite.TreeVisitor<?,org.openrewrite.ExecutionContext>
     

    Methods inherited from class org.openrewrite.ScanningRecipe

    clone, generate, generate, getAccumulator, getVisitor

    Methods inherited from class org.openrewrite.Recipe

    addDataTable, builder, buildRecipeList, causesAnotherCycle, 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

    • AddEventAnnotation

      public AddEventAnnotation()
  • Method Details