1
내가 내 json-에있는 자바 표현, 단지 문자열이없는이기타 된 JSONObject
{
"key1": "value1",
"key2": "valu2",
"content": {
"nestedkey1": "nestedValue1",
"nestedkey2": "nestedValue2"
}
}
객체처럼 안에 다른 JSON 객체를 JSON을, 보낼 안에 된 JSONObject를 처리 체재. 어떻게 올바르게 변환 될 수 있습니까?
내 접근 방식이 올바르지 않습니다. 항상 중첩 된 json에 대해 빈 문자열을받습니다. 이 중첩 된 객체에 대해 Map을 사용했지만 빈지도를 다시 사용했습니다.
public class Instance {
private String key1;
private int key2;
private String content;
public String getKey1 {
return key1;
}
public void setKey1(String key1) {
this.key1 = key1;
}
public BigDecimal getKey2() {
return key2;
}
public void setKey2(BigDecimal key2) {
this.key2 = key2;
}
public String getContent() {
return content;
}
public void setContent(String content) {
this.content = content;
}
어떤 라이브러리를 사용합니까? – skaffman
휴식 용 저지 –