Class NoRequestMappingAnnotation

java.lang.Object
org.openrewrite.Recipe
org.openrewrite.java.spring.NoRequestMappingAnnotation

public class NoRequestMappingAnnotation extends org.openrewrite.Recipe
Replace method declaration @RequestMapping annotations with the associated variant as defined by the request method type (GET, POST, PUT, PATCH, DELETE)

(HEAD, OPTIONS, TRACE) methods do not have associated RequestMapping variant and are not converted

  • @RequestMapping() changes to @GetMapping
  • @RequestMapping(method = POST) changes to @PostMapping
  • @RequestMapping(method = { HEAD, GET }) No change
  • Constructor Details

    • NoRequestMappingAnnotation

      public NoRequestMappingAnnotation()
  • Method Details

    • getDisplayName

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

      public String getDescription()
      Overrides:
      getDescription in class org.openrewrite.Recipe
    • getTags

      public Set<String> getTags()
      Overrides:
      getTags in class org.openrewrite.Recipe
    • getEstimatedEffortPerOccurrence

      public Duration getEstimatedEffortPerOccurrence()
      Overrides:
      getEstimatedEffortPerOccurrence in class org.openrewrite.Recipe
    • getSingleSourceApplicableTest

      @Nullable protected @Nullable org.openrewrite.TreeVisitor<?,org.openrewrite.ExecutionContext> getSingleSourceApplicableTest()
      Overrides:
      getSingleSourceApplicableTest in class org.openrewrite.Recipe
    • getVisitor

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