1.Bean public class User { private int id; private String username; private String password; public String getPassword() { return password; } public void setPassword(String password) { this.password = password; } public String getUsername() { return
fastjson序列化一个java bean,默认是根据fieldName的字母序进行序列化的,你可以通过ordinal指定字段的顺序,这个特性需要1.1.42以上版本.示例如下. import com.alibaba.fastjson.JSON; import com.alibaba.fastjson.annotation.JSONField; /** * Created by gary on 16/6/21. */ public class FieldSequence { @JSONFiel