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
1
vote
1 answer

ParseException NoClassDefFoundExcpetion for json-simple

I get this ERROR even though I added the jar file to my build path.How can I get the json-simple library working again.
vamsiampolu
  • 6,328
  • 19
  • 82
  • 183
1
vote
2 answers

Access to the values in a multi-level JSON-structure

There is my JSON-structure: { "date":"19.11.2013", "parent":{ "child1":[ { "date":"2013-11-19", "time":"10:30", }, { "date":"2013-11-19", "time":"12:20", …
Mark Korzhov
  • 2,109
  • 11
  • 31
  • 63
1
vote
3 answers

JSON-simple ClassCastException from String to JSONObject

I have an Array of JSON Objects like this: {"message":"[\"{\\\"name\\\":\\\"lays\\\",\\\"calories\\\":1.0}\",\"{\\\"name\\\":\\\"lays\\\",\\\"calories\\\":0.33248466}\"]"} I am trying to parse it using this code: Object object = parser.parse (…
W.K.S
  • 9,787
  • 15
  • 75
  • 122
1
vote
2 answers

JSON parsing using JSON-Simple not working

I'm having an issue trying to parse a string using json-simple, this is the sample string: { "items": [ { "id": "uy0nALQEAM4", "kind": "youtube#video", "etag": "\"g-RLCMLrfPIk8n3AxYYPPliWWoo/x3SYRGDdvDsN5QOd7AYVzGOJQlM\"", "status":…
m4design
  • 2,112
  • 3
  • 21
  • 28
1
vote
2 answers

Storing JSON document with AppEngine

I'm trying to store JSON document into the AppEngine datastore using Objectify as persistence layer. To be able to query for document values, instead of just inserting the whole document as String field, I created a MapEntity which looks like…
quarks
  • 33,478
  • 73
  • 290
  • 513
1
vote
1 answer

Why doesn't the JSON-Simple parser expect a colon, in Java?

I'm parsing a JSON block from twitter using JSON-Simple. I've run into an excepton: Exception in thread "main" Unexpected token COLON(:) at position 27...stack trace... I've seen something similar on SO due to some specialness in the way JavaScript…
AncientSwordRage
  • 7,086
  • 19
  • 90
  • 173
1
vote
0 answers

Java reading httprequest stream to process json is jibberish

JSONObject obj = new JSONObject(); br = new BufferedReader(new InputStreamReader(conn.getInputStream())); obj.put("auth key", br.readLine()); System.out.println(obj.toString()); br.close(); return "test"; The problem I am having with this code…
zidsal
  • 577
  • 1
  • 7
  • 30
0
votes
2 answers

json-simple containerFactory

Using the decoding example with the containerFactory, I get the following output: [{DeviceType=foo, DeviceName=foo1, IPAddress=192.168.1.1, UserName=admin, Password=pw}, {DeviceType=foo, DeviceName=foo2, IPAddress=192.168.1.2, UserName=admin,…
bentaisan
  • 1,056
  • 3
  • 12
  • 29
0
votes
2 answers

json-simple, reading from a file

I am trying to iterate through a file in the file system which contains configuration information for numerous devices. The file is in this format: { "myDevicesInfo": [ { "DeviceType":"foo", …
bentaisan
  • 1,056
  • 3
  • 12
  • 29
0
votes
1 answer

Convert generic Collection to JSON string using JSONSimple in Java

I have a non-typed collection of Entities and want to convert to JSON String, using JSONSimple. I've tried with JSONObject like: Collection entities; //supose its a non-typed Collection returned from service. JSONObject colJSON = new…
Fernando Magalhães
  • 539
  • 2
  • 9
  • 17
0
votes
2 answers

java/jsonsimple - use key to get value from a jsonarray

I have the following example json output form java/jsonsimple. The JSONArray is: [{"dd1":{"actionType":"Dept","collegeID":""}},{"dd2":{"actionType":"Dept","collegeID":""}}] I'm trying to figure out how to get the value for the "dd1" key by using…
tom smith
  • 1,035
  • 7
  • 23
  • 39
0
votes
2 answers

Decode JSON with Java

I am trying to decode JSON data with Java. I found a library at the following link: http://code.google.com/p/json-simple/wiki/DecodingExamples I have included the .jar file in the build path in my eclipse project, which added the library under…
Jake
  • 16,329
  • 50
  • 126
  • 202
0
votes
1 answer

JSON structure not being recognised as JSONObject or JSONArray

I'm having difficulty in parsing my json file into something that I can work with. The json file looks like this: { "characterizations_values": [ { "filename": "TestDoc", "sheet": { "my-title": [ …
spoons
  • 75
  • 5
0
votes
0 answers

Gradle build crashes with json-simple dependency

I'm encountering an issue with Gradle build of my javafx project after adding the json-simple library as a dependency. However, the build crashes, and I'm unsure about the cause of the problem. Here are the details of my setup: I added the…
Dabouz
  • 1
0
votes
2 answers

How to serialize a part of json

I have a json file with users, each users has email and password and corresponding POJO exist to deserialize them. I'm using both jackson and JSON.simple. However, I want to add users at will, and create a method to find them by their description,…
hetacz
  • 107
  • 10