博文

目前显示的是 七月, 2020的博文

Jackson in Java for JSON

Jackson, https://github.com/FasterXML/jackson Jackson has been known as "the Java JSON library" or "the best JSON parser for Java". Or simply as "JSON for Java". Jackson 3 core libs:streaming,databind,annotations. Jackson version: 1.x: org.codehaus.jackson.xxx;  2.x: com. fastxml .jackson.xxx To capitalize the first letter, you need the following: 1. Maven adds: <dependency> <groupId>com.fasterxml.jackson.core</groupId> <artifactId>jackson-databind</artifactId> <version>2.5.3</version> </dependency> 2. Add to the attributes: @JsonProperty( "Code") 3. Add to the Getter method: @JsonIgnore To implement toString()  import com.alibaba.fastjson.annotation. JSONField ; import com.fasterxml.jackson.annotation. JsonIgnore ; import com.fasterxml.jackson.annotation. JsonProperty ; import net.sf.json.JSONObject ; @Override public String toString () { return JSONObje...