0

I have a json data that I need to be parse in java
The data is in the form

["string1","string2","string3",...]


Any idea how I can do that?

2

3 Answers 3

2

You can use JacksonJSON. For a good tutorial, have a look here.

Sign up to request clarification or add additional context in comments.

Comments

1

You can use GSON api and use the code as below

Type type = new TypeToken<Collection<String>>(){}.getType();

List<String> results = new Gson().fromJson(json, type);

http://code.google.com/p/google-gson/

Comments

1

It depends a bit on how complete you want toe JSON parsing to be. If the above example is representative of all you expect, you might as well do some good old string parsing with indexOf and split.

If you want more complete JSON parsing, I'd suggest looking at the official json.org site and their Java page

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.