JsonNaming class

Sets the naming strategy of one class's properties, overriding the mapper's.

Put it on the class when one model talks to an API with another convention than the rest of the application. @JsonProperty on a property still wins.

// Rows of a snake_case export; other classes keep their names.
@Introspected()
@JsonNaming(PropertyNamingStrategy.snakeCase)
class Row { ... } // publishedAt → published_at

Spring (Java):

@JsonNaming(PropertyNamingStrategies.SnakeCaseStrategy.class)
class Row { ... }

Constructors

JsonNaming(PropertyNamingStrategy value)
Names the class's properties with value.
const

Properties

hashCode → int
The hash code for this object.
no setterinherited
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited
value → PropertyNamingStrategy
The naming strategy of the class's properties.
final

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() → String
A string representation of this object.
inherited

Operators

operator ==(Object other) → bool
The equality operator.
inherited