jackson use custom annotation for deserialization

wiz3

New Member
I have an annotation to indicate json property name \[code\]public @interface ApiField { /**json property name*/ public String value() default ""; }\[/code\]And a class like this\[code\]public class User{ @ApiField("last_name") String lastName; public String getLastName(){...} public void setLastName(String lastName){...}}\[/code\]And the json string is\[code\]{"last_name":"bob"}\[/code\]\[quote\] How can I use this annotation to indicates property name instead of @JsonProperty ?\[/quote\]
 
Back
Top