Questions tagged [flexjson]

Flexjson is a lightweight library for serializing and deserializing Java objects into and from JSON.

Flexjson - JavaScript Object Notation (aka JSON) is a very popular alternative to XML for transmitting data to the web browser. Flexjson is a lightweight library for serializing and deserializing Java objects into and from JSON. What's different about Flexjson is it's control over what gets serialized allowing both deep and shallow copies of objects. Most JSON serializers mimic object serialization libraries and try to serialize the entire object graph from the object being turned into JSON. This causes problems when you want a connected object model in your server, but you can't send that object model to the client because the serialization library will try to send the entire object graph. This makes it very hard to create object oriented models and serialize pieces of that model to the client without sending everything. Other JSON libraries require you to create a lot of boiler plate code to translate your object representation into a JSON object. In this regard I shouldn't have to explain myself, but to keep it short let's me just say I hate boiler plate translation code! Flexjson tries to solve both of these problems by offering a higher level API or dare I say DSL for specifying your intent.

Official Website: http://flexjson.sourceforge.net/

Useful Links:

87 questions
1
vote
2 answers

How can I serialize() a fmpp CsvSequence in FreeMarker?

I tried using both flexjson.JSONSerializer and com.fasterxml.jackson.databind.ObjectMapper in a freemarker template to convert a csv file loaded via the csv data loader csv(menu.csv, {trimCells: true}) to JSON. When I try to run this, I get the…
Peter T.
  • 2,927
  • 5
  • 33
  • 40
1
vote
0 answers

flexjson.JSONException: Duplicate key "atc" when activate ProGuard

I got the following JSONException when I run my app with ProGuard enabled. I tried different solutions found from other users but nothing seems to be working. proguard-rules.pro: -keep class flexjson.** {*;} -keepclassmembers class…
mrazvi
  • 11
  • 2
1
vote
0 answers

Get Ocsp Response from Json String

I am using bouncycastle version 15on to get ocspResponse from OcspServer as follows: public OCSPResp getOcspResponse(OCSPReq request, String urlStr){ HttpURLConnection con = null; OutputStream out = null; DataOutputStream dataOut =…
Hosein Aqajani
  • 1,553
  • 4
  • 26
  • 46
1
vote
1 answer

How to serialize and deserialize list of object arrays with flexjson?

does anybody know how to serialize and deserialize a list of object arrays with flexjson? What I have tried is this: @GET @Produces(MediaType.APPLICATION_JSON) @Path("/getAllGeoData") public String getAllGeoData(){ Listl =…
1
vote
3 answers

Parsing JSON into Map with FlexJSON

I am trying to parse a JSON structure similar to this one: { "cars": { "112": { "make": "Cadillac", "model": "Eldorado", "year": "1998" }, "642": { "make": "Cadillac", "model": "Eldorado", "year": "1990" }, "9242":…
Alex N.
  • 14,805
  • 10
  • 46
  • 54
1
vote
0 answers

How to parse a class with List as a field using FlexJson JSONDeserializer?

I want to parse a string to a class which has a List as a field and also another object. Here's the class: Result result; List params; and the string: { "result":{ "isOk":true, "message":"OK" }, "params":[ { …
Kamil
  • 1,456
  • 4
  • 32
  • 50
1
vote
1 answer

Escape non-ascii symbols by Flex JSON

I have java class which contains simple String fields and some of this fields can contain non-ascii symbols and wath that during serialization in JSON this symbols will be converted in \u0000. I know that I can do it by Jackson, but it can't be used…
Vartlok
  • 2,539
  • 3
  • 32
  • 46
1
vote
1 answer

Deserialize Json Object having abstract class in java

I am using flexjson for deserializing json string My Classes are as follows : public abstract class Content{ int id;} public class LoyaltyProgram{ Content content; // } How can i deserialize following json object…
Devloper
  • 120
  • 3
  • 14
1
vote
1 answer

Spring MVC: using Jackson for incoming requests and FlexJSON Serializer for responses

I'd like to use Jackson to deserialize JSON strings from client requests to Java objects and use FlexJson to serialize Java objects to response. In the nutshell the issue is: how to setup the Spring to use Jackson ONLY for request handling and not…
Dmitry B.
  • 99
  • 3
  • 9
1
vote
1 answer

FlexJson serializing and deserializing an interface

I get an error trying to deserializing my data structure, which is a list of items, every one of them implements an interface. In addition, one of the fields of the interface is object, and every inheritance treats this Object as different field.…
Oz Radiano
  • 779
  • 2
  • 11
  • 30
1
vote
0 answers

Deserialize Java Set using FlexJson

Im trying to use FlexJson to deserialize a json object in a Spring Roo Controller but an exception is being thrown an I cannot resolve it. DaysOfWeek.java public enum DaysOfWeek { SUNDAY("Sunday"), MONDAY("Monday"), TUESDAY("Tuesday"), …
CodeNameGrant
  • 124
  • 4
  • 16
1
vote
0 answers

How to format FlexJSON for emberjs

Hi I'm pretty new to both FlexJson and emberjs. According to the ember guides, ember requires json in the following format: { "post": { "comments": [1, 2, 3] } } I'm using the following for a particular model: public static JSONSerializer…
mjpwall
  • 106
  • 1
  • 7
1
vote
0 answers

How to serialize objects and properties in a particular order using FlexJson

I am new to FlexJson and am trying to have some understanding in it. I started with a simple piece of code. Here is the code: public class Statements { private String parent; private ArrayList children = new ArrayList(); public…
Mod
  • 5,091
  • 7
  • 28
  • 47
1
vote
2 answers

flexjson deserialize property string with dot "." inside

I'm trying to use flexjson to deserialize a string I get from a web call. The problem is that a few elements in there have a dot in the property/key for example: [{... "contact.name": "Erik Svensson", "contact.mail":…
dadoz
  • 11
  • 3
1
vote
1 answer

Flexjson(in Spring Roo) deserialization for Calender datatype

I am new to Spring Roo and this question is regarding the JSON de-serialization of Calender Java Datatype. I am using the reverse engineering feature of Spring ROO where I generate the model entities from my DB schema. The TIMESTAMP columns in the…
user1242321
  • 1,578
  • 2
  • 18
  • 30