json

Utilizzo di generici per ottenere metodi di classe tramite reflection in Java

Sto cercando di creare una classe di utilità che accetta qualsiasi tipo di POJO e convertire quel Pojo in un oggetto JSON usa ... asse json util che può prendere qualsiasi oggetto POJO e provare a creare automaticamente un jsonObject. Grazie in anticipo

Cosa significa sottoclasse anonima in java? [duplicato]

Questa domanda ha già una risposta qui: Come vengono utilizzate le classi anonime (interne) in Java? ... client creano un anonymous subclass vuoto. anonymous subclass mi fanno davvero confuso? Qualcuno può spiegarlo concretamente?

Come mappare i dati json con la classe java se i suoi cambiamenti, a volte i dati chages jsonArray a JsonObject in risposta

Sto ricevendo la risposta Json dal server e mappando i dati JSON con la classe Java. Ecco il codice. Gson gsonObj = new Gson ... mpelete che mi fornisce tutta la risposta sia jsonArray in risposta o JSonobject in risposta. Vi sarò grato per il mio aiuto.

API Testing / REST Assured Automazione Test Consigli e / o suggerimenti

Davvero alla ricerca di alcuni consigli pratici e di orientamento generale. Di seguito è riportato lo scenario attuale. Ho u ... trumento o framework per questo tipo di test. Se hai lavorato con qualcosa e puoi fornire un esempio che sarebbe fantastico.

Cerca e sostituisci SSN e / o Carta di credito in String Java

Sto cercando di cercare una stringa di testo per un numero di carta di credito e/o SSN in Java e quindi sostituire quella cor ... blic static String redactCC(String data){ Matcher m = ccDetector.matcher(data); return m.replaceAll(CC_PLACEHOLDER); }

Come trasformare la lista con in una lista usando la libreria jolt

Sto cercando di trasformare un json in un altro usando la libreria Jolt e non ottenendo l'output desiderato. Ecco il mio fil ... "name" : "FIX2-01" } ], "id" : "2" }, { "id" : "3" } ] Cosa sto facendo di sbagliato?

How and how to parse Json in Java?

There is often a need to work with Json, in particular its reading and parsing. In Java, you usually know what type of variab ... "type": "home", "number": "999 111-1234" } ] } ] }

How to parse Json in Java?

Hello! There is such a response from the server: { "p_result": "ok", "p_item": [ { "p_id": 132 ... sonObject userObject = user.getAsJsonObject(); userObject.get("p_id"); str = userObject.get("p_id").toString(); }

Read the JSON content for subsequent processing by HTML5 and JavaScript without AJAX and the server

I'm new to web programming. Faced with such a problem. There is a JSON file that is syntactically correct. It stores data, so ... as been blocked by CORS policy: No 'Access-Control-Allow-Origin' header is present on the requested resource. CORS policy (((

How to group an array of data in JavaScript

There is an array of data in JavaScript. We need to group them by property. For example, there is an array of employees: empl ... -01' } ] Now you need to group them, like: obj = { '2020-01-01' : { 111: { "salary": 5000 }, } }

GSON Android, well, I don't understand it at all

Hello. There are already 3,000,000,000 such questions. But I do not understand at all how to take and learn how to serialize ... ct.getJSONArray("p_item").toString()); } return new ArrayList<User>(); } And I can't even do it by analogy...

Error when outputting data from JSON Javascript

I have a JSON object (code below), and as soon as I want to parse it: json = JSON.parse(data); The console returns an erro ... 7, "name": "Ликер", "price": 3.4, "description": "Сладкий" }] }] }; json = JSON.parse(data);

How do I make an api request to stepik in java?

You need to get information about a specific course on stepik using the java api. I need to make a request so as to get a lis ... d it, you can take all the courses and filter out those where enrollment: null , but can someone look and help with the code?

How to read a JSON object in Java

I'm trying to read the JSON object in Java (just starting with JSON) JSON file: [ { "id": 0, "server": "Singleplaye ... oords_2": 76, "coords_3": 330 }, "name": "d", "time": "08:49:14 08/11/2020" } ] How can I read position?

Uncaught SyntaxError: Unexpected end of JSON input in JavaScript

I can't parse json-returns an error Uncaught SyntaxError: Unexpected end of JSON input. var xhr = new XMLHttpRequest(); ... alert('shit happens: ' + xhr.status + ', ' + xhr.statusText ); } } xhr.send(); xhr = JSON.parse(xhr.responseText);

How to construct html code from a javascript object that needs to use key values

Here's what I tried to do in php: global $conn; $sql = "SELECT * FROM gallery ORDER BY id DESC" ... hod, but in javascript, the functions from the decoded object.I ask for help from experts in javascript.Thank you in advance!

JSON-RPC request in Java

Citizens, hello to all!) Can someone explain to me the requirements for passing a JSON-RPC request? That is, there is a serv ... There is code in C# that works correctly, but to write it in java does not have enough understanding of how the query works.

Yandex direct API how to execute a json request from Java?

Yandex direct API how to execute a json request from Java? Here https://tech.yandex.ru/direct/doc/start/format-docpage/ instr ... aign 1","Id":318390},{"Id":318391,"Name":"Test API Sandbox campaign 2"},{"Id":318392,"Name":"Test API Sandbox campaign 3"}]}}

JSONArray and JSONObject

I faced such a problem. Please tell me what's wrong? And how to fix it? FileReader reader = new FileReader(filePath); ... ption: org.json.simple.JSONObject cannot be cast to org.json.simple.JSONArray at TestBooking.main(TestBooking.java:48)

How to parse a json file in java if it is in Unicode

How to parse a json file in java if the json file is completely in unicode, how can I choose the tags from which to parse the ... d\u0434\u0440\u0456\u0439\u0412\u0430\u043b\u0435\u0440\u0456\u0439\u043e\u0432\u0438\u0447", "1241":"\u0404\u0432\u0434" }