在学习使用Jackson时,看了
http://blog.youkuaiyun.com/gjb724332682/article/details/51586701之后就下手写了个demo
public class CountryEntity implements Serializable {
private String code;
private String country;
private String letter;
public CountryEntity() {
}
public CountryEntity(String code, String country) {
this.code = code;
this.country = country;
}
public String getCode() {
return code;
}
public void setCode(String code) {
this.code = code;
}
public String getCountry() {
return country;
}
public void setCountry(String country) {
this.country = country;
}
public String getLetter() {
return letter;
}
public void setLetter(String letter) {
this.letter = letter;
}
}
一开始readValue和writeValueAsString时