Package org.axonframework.migration
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 ClassesNested 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 -
Method Summary
Modifier and TypeMethodDescriptiongetInitialValue(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, getVisitorMethods 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
-
Constructor Details
-
AddEventAnnotation
public AddEventAnnotation()
-
-
Method Details
-
getDisplayName
- Specified by:
getDisplayNamein classorg.openrewrite.Recipe
-
getDescription
- Specified by:
getDescriptionin classorg.openrewrite.Recipe
-
getInitialValue
- Specified by:
getInitialValuein classorg.openrewrite.ScanningRecipe<AddEventAnnotation.Accumulator>
-
getScanner
public org.openrewrite.TreeVisitor<?,org.openrewrite.ExecutionContext> getScanner(AddEventAnnotation.Accumulator acc) - Specified by:
getScannerin classorg.openrewrite.ScanningRecipe<AddEventAnnotation.Accumulator>
-
getVisitor
public org.openrewrite.TreeVisitor<?,org.openrewrite.ExecutionContext> getVisitor(AddEventAnnotation.Accumulator acc) - Overrides:
getVisitorin classorg.openrewrite.ScanningRecipe<AddEventAnnotation.Accumulator>
-