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

Why can't I successfully call the .put method here?

I made a JSONArray object but can't seem to call the .put method on it. Does anyone know why?
Kevin
  • 61
  • 8
0
votes
2 answers

How can I access inner JSON elements with simple json in JAVA?

I have this JSON for example: { "mesaje": [{ "cif": "111", "data_creare": "29.11.2019 07:52:24", "id_solicitare": "222", "tip": "SOLICITARE", "id": "333", "detalii": "duplicat pentru CUI 111" }, { "cif": "444", …
SECI
  • 103
  • 2
  • 10
0
votes
2 answers

Error trying to parse JSON from Command Line in Java

Am using Java 1.8 and the following dependency in pom.xml: com.googlecode.json-simple json-simple 1.1.1 This is my sample command line app that I…
PacificNW_Lover
  • 4,746
  • 31
  • 90
  • 144
0
votes
1 answer

Writing multiple times on a JSON file with Java

I'm trying to write multiple times on a JSON file using JSON-Simple and Java, but I have some problems after the second run. I'm new to JSON so that's just a way to learn about it, here is the code: public class Writer{ …
Slaike
  • 23
  • 4
0
votes
2 answers

Null pointer observed while trying to fetch the object value from JSON array

I'm trying to loop the calls: JSON array and trying to fetch the machine details JSON object which is present under calls JSON array list as like below: { "":{ "type":"CORR-ID", "tags":[ { …
ArrchanaMohan
  • 2,314
  • 4
  • 36
  • 84
0
votes
2 answers

Json Parsing: How to fetch "body" data inside "body array" using Gson (or better in other java library or notation supported)?

My Rest API is returning the following response, in which only the inner list is required, all data shall be discarded: { "meta": [], "links": [], "body": [ { "meta": [], "links": [], "body": { "field1":…
fatherazrael
  • 5,511
  • 16
  • 71
  • 155
0
votes
0 answers

Terminal command to run Java file with json-simple-1.1.1.jar

I have a Java project where I am using json-simple-1.1.1.jar. I'm using IntelliJ and Maven to run my project and I'm using Windows. I set up my classpath for json-simple-1.1.1.jar in my environment variables and I set up the dependencies on…
Janeen
  • 35
  • 3
0
votes
1 answer

How to make a constant json array with JSON Simple

I'm looking to make a very simple object with JSONSimple, that uses a constant array: { "user":"fei0x", "permissions":[10,20] } How do I construct the array portion? I tried to use a primitive array, but instead it creates an object with each…
fei0x
  • 4,259
  • 4
  • 17
  • 37
0
votes
1 answer

How to get the values from keys in nested objects using only json-simple

I want to get only a specific value out of all the nested objects. In the application I just need the msg 3 which is inside another object messages. I have tried it using JSONObject but it is not working for nested object. However It is working with…
SAM SAMULE
  • 35
  • 1
  • 4
0
votes
2 answers

How to find out if key exists or not when parsing json data

I am trying to parse json file using Java.My json file format is given below.I was trying to print a message if the action is a "note" and print performed_at. However,there is no output for the below code. Thanks in advance for the advice and your…
user8720570
  • 75
  • 1
  • 8
0
votes
1 answer

is there an json simple function to get all the keys from a jsonobject?

I'm trying for the first time to use the jsonsimple library on java. So i formatted a json object using a String. the Object is the following { "mario":{ "city": "rome", "birth": 1980, "haircolor": "blonde" }, "Lucas": { "city":…
0
votes
0 answers

Explicitly state type for nullable field with a JSONObject

I am working with the Json Simple library, but I need a variable to explicitly say what type of variable this is. For example, "date": {"int": 18002}, Otherwise it will not be able to be posted to the kafka server. Right now I am using this…
MrDaveForDays
  • 121
  • 1
  • 7
0
votes
1 answer

Character encoding of parsed strings is wrong only after building jar

I am writing a program that generates PDF files of printable exams. I have all the exam questions stored in a JSON file. The catch is that the exam is in Czech, so there are many special characters (specifically ěščřžýáíé). When I run the program in…
vitr
  • 11
  • 1
0
votes
1 answer

How to get a certain elements inside an array inside a jsonObject

I'm exporting some data in java using JSON then I'm reading that data and trying to get elements from an array inside the JSON object but I'm having issues. I have tried a lot of things like jsonObject.get("InGameCord").get("x") Object Testo =…
A Hamburgler
  • 79
  • 1
  • 2
  • 7
0
votes
2 answers

Jar file Error because of simple JSON dependency

I have a maven project that uses the json-simple library. When I create jar file using mvn clean mvn test mvn install and try to run the jar file using java -jar target/Game2048-1.0-SNAPSHOT.jar I get an error as shown below: My pom.xml file is as…
Chetan
  • 469
  • 3
  • 12
  • 27