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
0
votes
2 answers

Parsing a JSONObject inside a JSONObject in a single line with json.simple

Lets say I want to parse a JSONObject with JSONObjects inside of it, which I parse from a string. I want to do this in a single line, like I've done with other libraries, but I'm not sure how. JSONParser parser = new JSONParser(); Object obj =…
mathExpl
  • 79
  • 1
  • 1
  • 5
0
votes
1 answer

finding three neighbors value in json value array

I am finding three neighbors of value (6,33).what is the best way to do that. am using json-Simple for reading file.if the origin is (6,33), then the first item in the output would be the coordinate closest to(6,33), then the second closest, then…
Nan2015
  • 21
  • 4
0
votes
1 answer

Convert List to JsonObject in Java using json simple

I have a list - List items = new ArrayList; which consists of items - [firstname , abc , lastname , pqr , id , 1 ] I need to convert this list to JSONObject of below format in java using json simple lib…
Spandana
  • 121
  • 1
  • 2
  • 13
0
votes
0 answers

JSON content from file via Java

My program parse JSON from file where is saved unstructured content of this json adress. Unstructured json format from file…
koubik
  • 13
  • 2
0
votes
1 answer

Problem with JSONValue

Am I totally missing something here? Why can't I get out what I'm putting in? Set stringSet = new LinkedHashSet(); stringSet.add("firstName"); Map payload = new…
Chris Dutrow
  • 48,402
  • 65
  • 188
  • 258
0
votes
2 answers

I'm trying to read a json file, but compiler says, Parser cannot be resolved JAVA

I've downloaded and added a json-simple.jar to my project in eclipse. The only problem is with the Parser, Eclipse says "parser cannot be resolved". While the JSONObject and JSONArray are working just fine. I get the error when trying to read the…
omlfc be
  • 147
  • 2
  • 13
0
votes
1 answer

json array to individual strings

Assignment: I am using json-simple. How can I convert this json data into individual java strings? (Please forgive me if you think that this is a low-level question - I am new to JSON, so I don't know much about that - I've searched a lot, but I…
abhishake
  • 763
  • 9
  • 16
0
votes
2 answers

Get object list with lists from JSON with JSON.Simple

I have a JSON array with arrays inside. How can i Parse this using Json.simple. JSON Object example: [ { "ID":"1", "Objects":[ { "ObjectID":"5" }, { "ObjectID":"9" …
joey
  • 469
  • 1
  • 6
  • 22
0
votes
0 answers

accessing data from nested arrays and objects from json string in java(json-simple)

Im unable to access data from nested objects from the inner elements. This is the json string- {"created_at":"Tue Jun 14 04:06:55 +0000 …
Romit Kumar
  • 2,442
  • 6
  • 21
  • 34
0
votes
1 answer

Parsing JsonArray inside JsonArray(nested)

I make a call to REST services and it returns a json string, looks like: { "head":[ "\"head1\"", "head2", "head3" ], "tail":[ [ "tail1", "tail2",' …
srikanth
  • 958
  • 16
  • 37
0
votes
3 answers

Merging Two JSONArray inside JSONObject in JAVA

Hi i have a problem regarding the merge of JSONArray inside JSONObject. Below is what my JSONObject looks like: { "name":"sample.bin.png", "coords":{ "1":{"x":[ 974, 975],"y":[154, 155}, "3":{"x":[124, 125],"y":[529]}, …
Seeker
  • 1,877
  • 4
  • 32
  • 56
0
votes
1 answer

How to decoding JSON file in order to receive array of id values with json-simple library?

I have a JSON file. I need to get only array of id values (30461, ...) { "response":[ 5205, { "id":30461, // target value! "from_id":-52078741, "to_id":-52078741, "date":1459435510 ... How to receive an array of id…
Cat
  • 11
  • 2
0
votes
1 answer

JSONSimple key finder for array

There is a very nice KeyFinder example on the json-simple docs But if I try to get an array, it will only return me the first element json {"foo": {"bar": {"foobar":{ "items":["item1","item2","item3"] } …
DeMarco
  • 599
  • 1
  • 8
  • 26
0
votes
1 answer

JSON Parser recommendation: Is there a JSON Parser which maintains order?

I know a JSON that maintains order is no longer JSON, but this is a requirement in some use and throw code. I have read other hacks like replacing HashMap with LinkedHashMap in the JSONObject.java file. I was wondering if there is a parser which…
gnsb
  • 327
  • 3
  • 8
  • 18
0
votes
3 answers

JSON Simple - Encoding Array

Hi I am using JSON simple library. I have a JSON file like this: [ "string", { ... }, { ... } ... ] I have no problem parsing it. But when I finish my application and try to save the changes I cannot add a…
ossobuko
  • 851
  • 8
  • 25