Questions tagged [json-simple]

JSON.simple is a Java-to-JSON binding API that serializes and deserializes JSON data to and from Java data structures.

JSON.simple is a Java-to-JSON binding API designed to be a simple Java toolkit to encode or decode JSON text.

See also:

234 questions
-2
votes
3 answers

How to create a JSON Array of JSON objects with a Java for loop?

I have a for loop which iterates and generates key value pairs for different employees. I need to create a JSON array like below and write it to a JSON file at the end. I am having trouble figuring out the ideal way to code it (JSON Objects -> JSON…
AutoTester999
  • 528
  • 1
  • 6
  • 25
-2
votes
1 answer

Problems to continue to parse JSON to JAVA

I am trying to parse a json string to java but have got stuck. My code looks like the below. public static void main(String args[]) throws FileNotFoundException, IOException, ParseException { // parsing file "JSONExample.json" Object…
JavaNisse
  • 17
  • 5
-2
votes
2 answers

How to write 2 two-dimensional array to json object in java using json-simple?

I'm setting up a java game server request handler that get json messages and send back relevant json message as response. In some cases I need to send 2 dimensional String array as the game board. I'm having a problem to do that using json-simple.…
Niv Lusty
  • 33
  • 8
-2
votes
1 answer

checking if a string that is a array of JSONObject is empty

So I am receiving, a jsonobject from an api call. inside the jsonobject there is a field that can hold an array of JSONObjects for example { "order":[]} how can I check if the array is empty or not? JSONSimple library JSONObject[] check = new…
Tim Willis
  • 140
  • 10
-2
votes
1 answer

org.json.simple.JSONObject cannot be cast to java.lang.String

I want to retrieve cliendId and clientSecret into 2 different Strings. I am trying to do String responseEntity = secretRequestMap.get("responseEntity").toString(); to get the responseEntity into a string and then parse it again, using JSON…
JavaPassion
  • 75
  • 1
  • 3
  • 9
-2
votes
1 answer

How to get key taken from data taken from website API

I am currently coding in Java using Eclipse. I am trying to obtain the value of the key "high" given the data {"high": "639.00000", "last": "634.94000", "timestamp": "1476220216", "bid": "634.94000", "vwap": "630.07099", "volume": "7939.75947138",…
Nick Oh
  • 25
  • 4
-2
votes
1 answer

How to get names of objects within object? (JSON)

I am trying to figure out (using json-simple) how to get the name of an object within an object. For example: { { "objs": { "obj1": "blah", "obj2": "blah" } } } I would like to get the value obj1 and obj2 (as they're the names of the objects, which…
LewisTehMinerz
  • 656
  • 7
  • 15
-3
votes
4 answers

Why can't read a .json?

I want to read a .json using library json-simple, my json file is: { "Subjects": { "subject1": "MIS", "subject2": "DBMS", "subject3": "UML" } } And my code is: import java.io.*; import java.util.*; import…
riram
  • 162
  • 6
-4
votes
1 answer

Parsing Nested JSON Array with json-simple

Trying to use json simple to parse data from rest service. The response looks like: { "locations": [ "city" : "San Jose", "state" : "Ca", "job" : { "site" : "Main Processing", "region" : "USA" } ] } JSONParser…
R_GAIT
  • 1
  • 1
  • 3
1 2 3
15
16