5
votes
2answers
185 views

Check if a value exists or catch an exception

I am parsing a response from server, and in case it contains the fields "chunk_number"(J_ID_CHUNK_NUMBER) and "total_chunk_number"(J_ID_CHUNK_TOTAL), I want to check whether I should request another ...
3
votes
1answer
1k views

Is there another way / proper way of parsing this JSON array ?

I have a JSON object which holds some json_array like this: (with org.codehaus.jettison.json.*) json array:[{"C1":["S1","S2"]},{"C2":["S1","S2"]},{"C3":["S1","S2"]},{"C4":["S1","S2"]}] I have to ...
2
votes
1answer
62 views

Json whitespace formatter

I couldn't quickly find Java code with googling to make serialized Json easier to read (this is a debugging library, obviously implementation code wouldn't use this as it's just more characters). This ...
1
vote
2answers
157 views

Simple JSON writer

I am working on a way to quickly build JSON strings in Java. To this end, I have created the following two files. Assuming that I do not need to parse JSON strings for Java, is this an efficient ...
1
vote
1answer
515 views

An efficient way to shuffle a JSON array in java? (reposted from SO)

This is my first question here so I hope I don't break the protocol too much :) I originally posted this question in SO: ...
1
vote
0answers
138 views

How to add faster object to an array

I have a list with contentlets and want all languages from every contentlet (I get these with the method languageAPI.getAllValuesByKey(key , contentList). I get a Hashmap and iterate over it. There ...