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

Apache 2.0

Rename JsonGenerator methods that were renamed in 3.x (e.g., writeObject() to writePOJO(), getCurrentValue() to currentValue()).

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

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.core.JsonGenerator getOutputContext() to streamWriteContext
  2. Change method name com.fasterxml.jackson.core.JsonGenerator getOutputTarget() to streamWriteOutputTarget
  3. Change method name com.fasterxml.jackson.core.JsonGenerator getOutputBuffered() to streamWriteOutputBuffered
  4. Change method name com.fasterxml.jackson.core.JsonGenerator canOmitFields() to canOmitProperties
  5. Change method name com.fasterxml.jackson.core.JsonGenerator getCodec() to objectWriteContext
  6. Change method name com.fasterxml.jackson.core.JsonGenerator getCurrentValue() to currentValue
  7. Change method name com.fasterxml.jackson.core.JsonGenerator setCurrentValue(..) to assignCurrentValue
  8. Change method name com.fasterxml.jackson.core.JsonGenerator writeObject(..) to writePOJO
  9. Change method name com.fasterxml.jackson.core.JsonGenerator writeArrayFieldStart(..) to writeArrayPropertyStart
  10. Change method name com.fasterxml.jackson.core.JsonGenerator writeBinaryField(..) to writeBinaryProperty
  11. Change method name com.fasterxml.jackson.core.JsonGenerator writeBooleanField(..) to writeBooleanProperty
  12. Change method name com.fasterxml.jackson.core.JsonGenerator writeFieldId(..) to writePropertyId
  13. Change method name com.fasterxml.jackson.core.JsonGenerator writeFieldName(..) to writeName
  14. Change method name com.fasterxml.jackson.core.JsonGenerator writeNullField(..) to writeNullProperty
  15. Change method name com.fasterxml.jackson.core.JsonGenerator writeNumberField(..) to writeNumberProperty
  16. Change method name com.fasterxml.jackson.core.JsonGenerator writeObjectField(..) to writePOJOProperty
  17. Change method name com.fasterxml.jackson.core.JsonGenerator writeObjectFieldStart(..) to writeObjectPropertyStart
  18. Change method name com.fasterxml.jackson.core.JsonGenerator writeOmittedField(..) to writeOmittedProperty
  19. Change method name com.fasterxml.jackson.core.JsonGenerator writePOJOField(..) to writePOJOProperty
  20. Change method name com.fasterxml.jackson.core.JsonGenerator writeStringField(..) to writeStringProperty