Questions tagged as 'gson'

1
answer

http access via gson with parameters

In my first venture into android development, I came across the following need. I need to create a login screen by accessing the one address and capturing the gson's return below. How could I do it? LOGIN URL: /api/auth/login Method: POST Da...
asked by 03.04.2017 / 22:49
1
answer

Problem using Gson on Wildfly

I'm trying to use GSON in a Maven EJB project but it gives the following error:    java.lang.NoClassDefFoundError: com/google/gson/Gson When I test in the main class without going up the server lib works normally. Has anyone...
asked by 24.02.2017 / 15:46
2
answers

JSON format in LocalDate field

Personal I have the following record being returned by a query using SpringData : page = grupoService.findByNomeStartingWithOrderByNomeAsc(2, pageable); If I run the following code: System.out.println(page.getContent().get(0)); I...
asked by 26.08.2016 / 19:44
1
answer

"Can not be converted to JSON" error when trying to create JSONObject from String

I'm using the Kotlin language together with the GSON library to do parse creation / parsing of JSON objestos. I have the following string that stores a JSON object returned from a server val jsonString = "{"age":22,"height":1.8,"profession"...
asked by 05.05.2016 / 21:14
3
answers

Gson: serializing dates in various formats

I'm using Gson and need to serialize a class with different date formats: @TimeStampField(onlyDate = false) private Timestamp datahora @TimeStampField(onlyDate = true) private Timestamp diaLimite I wanted to get these annotations inside my...
asked by 11.11.2015 / 14:02
1
answer

Error in java code read GSON: java.lang.NullPointerException

I'm trying to read this file but when I run this error: Exception in thread "main" java.lang.NullPointerException at principa.Main.main(Main.java:61) but I do not know what is null public class Main { public static void main(Stri...
asked by 04.12.2017 / 02:32
1
answer

Create POJO for JSON

I have a problem creating a POJO of this Json (end of question). Classes > > > > Main public class teste { public static void main(String[] args) { ((Runnable) () -> { System.out.println("PreExecute");...
asked by 06.01.2017 / 07:10
1
answer

Application is closing, while consuming webservice

I have a problem in my application, when consuming a web service service in Json, the application is closing. The idea of my application is to consume this web service to validate my email and password, and returning a Json with my user data...
asked by 06.11.2015 / 19:00
1
answer

Word reserved as variable name

I'm building a program that integrates an online store with another program that controls the physical inventory of a store. Communication is done through HTTP requests that respond in JSON format. In one of the response JSON, I have a variab...
asked by 23.11.2018 / 17:56
1
answer

Problem picking up a GSON variable

I'm making an app that uses the google maps directions api, which returns me a json, for example: { "geocoded_waypoints" : [ { "geocoder_status" : "OK", "place_id" : "ChIJeRLP8gx3GZURImtwaSWGJgY", "types" :...
asked by 11.11.2017 / 02:54