Skip to content

Replace references to "field" with "property" in JsonGenerator, JsonParser, method names; JsonToken values (JsonToken.FIELD_NAME -> JsonToken.PROPERTY_NAME) #670

@cowtowncoder

Description

@cowtowncoder

One confusing aspect of naming in some parts of Jackson is reference to Object "fields": although there are a few alternatives (field, property, entry at least), we have mostly settled on "property" as the standard thing.
So with 3.0 let's try to unify JsonGenerator and JsonParser API (and supporting helpers types like context objects) to use "property" wherever "field" used to be used.

Changes include: (I'll try to add notes on all changes)

  • JsonToken: FIELD_NAME became PROPERTY_NAME (probably the biggest change externally)

  • JsonParser:

    • getCurrentName()->currentName()
    • nextFieldName()->nextName()
  • JsonGenerator:

    • writeFieldName() -> writeName()
    • All writeXxxField() became writeXxxProperty()
    • All writeXxxFieldStart() became writeXxxPropertyStart()
    • writeObject() changed to writePOJO() (since "object" here did NOT refer to JSON Object but to Java Object)
  • PrettyPrinter:

    • writeObjectFieldValueSeparator() -> writeObjectNameValueSeparator()
  • Separators: (used by PrettyPrinter)

    • getObjectFieldValueSeparator() -> getObjectNameValueSeparator()
    • withObjectFieldValueSeparator() -> withObjectNameValueSeparator()

Metadata

Metadata

Assignees

No one assigned

    Labels

    3.xIssues to be only tackled for Jackson 3.x, not 2.x

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions