Created
October 13, 2011 18:49
-
-
Save stoicflame/1285114 to your computer and use it in GitHub Desktop.
Custom JSON Jackson Properties
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class User { | |
private Date dtBirth; | |
@JsonIgnore | |
public Date getDtBirth() { return dtBirth; } | |
@JsonIgnore | |
public void setDtBirth(Date dtBirth) { this.dtBirth = dtBirth; } | |
@JsonProperty("dtBirth") | |
@JsonName("dtBirth") //tell enunciate what the name of the json property is because enunciate doesn't yet recognize jackson annotations. | |
public String getDtBirthAsString() { ... } | |
@JsonProperty("dtBirth") | |
public void setDtBirthAsString(String dtBirth) {...} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment