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

Liferay and Flexjson (JSON Serialization) : Date formatting

Original Question I found this wiki on Liferay website --> https://web.liferay.com/community/wiki/-/wiki/Main/JSON+Serialization it says that I can serialize objects to JSON by just using the code below JSONFactoryUtil.looseSerialize(object); It…
Neil Catalan
  • 45
  • 1
  • 9
0
votes
1 answer

flexjson deserialization in play framework

I am trying to use flexjson in a playframework java project. But I am unable to deserialize json string to object. I am getting Could not load class exception while trying to deserialize caused by class not fount exception. I am using google guice…
Venu Gandhe
  • 77
  • 1
  • 8
0
votes
2 answers

Json Object Deserialization

I want to desalinize following JSON object to Java Object (Location Class) : { "city": "TEST", "country": "TEST", "latitude": "1", "longitude": "1", "name": "TEST", "postalCode": "362001", "street": "TEST", "organization": 3 } My…
Devloper
  • 120
  • 3
  • 14
0
votes
1 answer

app works if jar is local to the project and does not if it's referenced by build path (was "flexjson 3.2 strange bug")

I have two java projects in my eclipse indigo. One of them (let's call project A) has the flexjson 3.2 jar in its lib directory. The other project (let's call project B) has a reference to the same jar, in its build path. Both projects connect to a…
Leo
  • 6,480
  • 4
  • 37
  • 52
0
votes
0 answers

How to insert a serialized json string into another json object /nested?

I have json serialized arraylist in java which i want to insert into another json object, how can i do this without having double quotes on my json string? JSONSerializer serializer = new JSONSerializer(); String serializedList =…
Mac Luc
  • 971
  • 5
  • 14
  • 31
0
votes
3 answers

Flexjson or Gson : Protect object references after object serialization

I serializing a list with flexjson. After serialization, I printing object hashcode() and I would check to see if the objects are equal. Problem, after the operation the object reference are changing. I don't want it. My code; String…
Gnosis00
  • 309
  • 6
  • 19
0
votes
1 answer

How to have flexjson TypeLocator throw exception on missing value?

I have a JSONDeserializer like so: if (json != null) { response = new JSONDeserializer().use(null, EnvelopeBuilder.class) // Target .use("header.targetIdentifier", EnvelopeJsonCodec.locator) …
Lorin S.
  • 754
  • 8
  • 29
0
votes
3 answers

How to get List from json string using FlexJson Json serializer in Java?

String episodeIds = "['abc', '123', '456']"; List list = new JSONDeserializer>().use(null, ArrayList.class).deserialize(episodeIds); System.out.println(list); This code returns string but must return LONG)
alexn
  • 1
  • 1
  • 2
0
votes
0 answers

deserialize JSON to an ArrayList with Flexjson (Java Android)

I want to deserialize this json data into an ArrayList {"users":[{"username":"jon@jafprod.com","pw":"123456","data":""},{"username":"fred@jones.com","pw":"abcde","data":""}]} this is the class public class UserClass { public String email; …
user3561494
  • 2,164
  • 1
  • 20
  • 33
0
votes
1 answer

Gridx Server-side filtering - reference? example?

I have successfully created a: Gridx using JSONStore Server-side paging using 'Range : items=0-99' header Server-side sorting using 'sort(+name)' ... but after much effort and searching I haven't been able to setup the Filterbar module to perform…
0
votes
1 answer

How can one control the size of serialized object of Json serializer

Lets assume following is my object model: Person { String name; List
addressesList; } Address { String field1; String field2; } I am trying to serialize the Person object using flex JSon Serializer. I have some limit on the size of the…
PhantomM
  • 825
  • 6
  • 17
  • 34
0
votes
1 answer

FlexiJSon - Serialize Deserialize

I have two different programs- one which serializes data and saves it to a local file, and the other program loads the data and use it. The problem is that the deserializing is not working - the same structure it was serealized in cannot be…
Oz Radiano
  • 779
  • 2
  • 11
  • 30
0
votes
1 answer

Serializing a static inner class with FlexJSON

I'm trying to serialize this inner class static class functionMessage{ String type = "function"; String id; String function; Object parameters; public functionMessage(String ID, String Function, Boolean Parameters) { …
user1382306
0
votes
2 answers

RooWebJson and KendoUI Grid

I made KENDOUI GRID work for READ with Spring ROO json as the backend. However, for CREATE the generated response is HTTPSTATUS.CREATED. KENDOUI GRID is expecting a HTTPSTATUS.OK with response body of "null". I verified this by pushing-in the roo…
javapadawan
  • 897
  • 6
  • 12
  • 29
0
votes
1 answer

Flexjson unable to deserialize LinkedHashMap

I am deserialising a json object as below { "b":"value1", "a":"value2", "d":"value3", "c":"value4", "f":"value5", "e":"value6" } But i am getting ClassCastException as below java.lang.ClassCastException:…