Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 9 additions & 8 deletions src/main/java/com/fasterxml/jackson/annotation/JsonProperty.java
Original file line number Diff line number Diff line change
Expand Up @@ -24,20 +24,21 @@
* Java fields in a single declaration like:
*<pre>
* public class POJO {
* \@JsonProperty("a")
* public int a, b, c;
* {@literal @JsonProperty}("a")
* public int a, b, c;
* }
*</pre>
* since it would associate same annotation for all fields, leading to name
* collision.
*<p>
* Starting with Jackson 2.6 this annotation may also be
* used to change serialization of {@code Enum} like so:
*<pre>
public enum MyEnum {
{@literal @JsonProperty}("theFirstValue") THE_FIRST_VALUE,
{@literal @JsonProperty}("another_value") ANOTHER_VALUE;
}
</pre>
* public enum MyEnum {
* {@literal @JsonProperty}("theFirstValue") THE_FIRST_VALUE,
* {@literal @JsonProperty}("another_value") ANOTHER_VALUE;
* }
*</pre>
* as an alternative to using {@link JsonValue} annotation.
*<br>
* NOTE: for {@code Enum}s, empty String is a valid value (and
Expand All @@ -49,7 +50,7 @@ public enum MyEnum {
* of property: this property is only used by certain format backends (most
* notably XML).
*<p>
* NOTE: if a exclusion marker like {@link JsonIgnore} is also present,
* NOTE: if an exclusion marker like {@link JsonIgnore} is also present,
* property accessor is excluded; ignoral has higher precedence over inclusion.
*/
@Target({ElementType.ANNOTATION_TYPE, ElementType.FIELD, ElementType.METHOD, ElementType.PARAMETER})
Expand Down