[JAVA]Json Parsing
배움/JAVA
파일에서 Json 파싱해서 JsonArray로 담기
JSONArray jArray = new JSONArray();
JSONParser parser = new JSONParser();
//설정 File에서 Json Parsing
Object parserObj = parser.parse(new FileReader("src/main/resources/config.json"));
JSONObject jsonObject = (JSONObject) parserObj;
//JsonNam을 변수로 받아서 특정 Json을 가져옴
jArray = (JSONArray) jsonObject.get(jsonName);
'배움 > JAVA' 카테고리의 다른 글
[Java] 정렬, Collections.sort와 Arrays.sort 차이점 (0) | 2021.07.27 |
---|---|
[JAVA]코딩 테스트 자료 모음 (0) | 2021.06.15 |
[JAVA]Version 1.4.2_03 of the JVM is not suitable for this product, (0) | 2012.02.09 |