1 2 3 4 5 | <dependency> <groupId>org.glassfish</groupId> <artifactId>javax.json</artifactId> <version>1.0.4</version> </dependency> |
1 2 3 4 5 6 7 | String json = "{\"id\":3}"; JsonReader reader = Json.createReader(new StringReader(json)); JsonObject rootObject = reader.readObject(); reader.close(); int devID = rootObject.getInt("id"); String sDevID = Integer.toString(devID); |
No comments:
Post a Comment