Rename Jackson 2.x methods to 3.x equivalents for JsonNode

Apache 2.0

Rename JsonNode methods that were renamed in 3.x (e.g., elements() to values(), fields() to entries()).

org.openrewrite.java.jackson.UpgradeJackson_2_3_JsonNodeMethodRenames
mod run . --recipe=org.openrewrite.java.jackson.UpgradeJackson_2_3_JsonNodeMethodRenames

Install it once from Recipe actions, then run it on every repository under the current directory. New to the Moderne CLI? Set it up.

Recipe list

It runs these recipes, in this order.

  1. Change method name com.fasterxml.jackson.databind.JsonNode asText(..) to asString
  2. Change method name com.fasterxml.jackson.databind.JsonNode findValuesAsText(..) to findValuesAsString
  3. Change method name com.fasterxml.jackson.databind.JsonNode isContainerNode() to isContainer
  4. Change method name com.fasterxml.jackson.databind.JsonNode isTextual() to isString
  5. Replace JsonNode.textValue() with stringValue(null)
  6. Change method name com.fasterxml.jackson.databind.JsonNode textValue() to stringValue
  7. Change method name com.fasterxml.jackson.databind.JsonNode with(..) to withObject
  8. Migrate JSONNode field iterator for Jackson 3