1

Here is a link that tells us how to extract json from a text! Extract JSON from text

But I need it use Java with high performance, and I really don't want use the three-part plugin to help with.

Who can help me? it got me crazy. Thank you all.

Community
  • 1
  • 1
Mr rain
  • 983
  • 5
  • 13
  • 27
  • have you looked at Jackson: http://jackson.codehaus.org/ ? also search for GSON. lots of java libs for this depending on your needs – pb2q May 18 '12 at 03:10
  • Parsing JSON is easy, and is not inefficient (other than the cost of creating the resulting objects). What precisely is your problem? – Hot Licks May 18 '12 at 03:10

1 Answers1

1

Do you really have a performance problem? Hard to know if you haven't measured it. And that's hard to do if you haven't written any code yet. Look you aren't going to write a super fast JSON parser that no one else hasn't already done for you. You're roughly going to have to do the same amount of work that anyone who created a 3rd party plugin has already done. Stop worrying about performance and go get a library to do this for you. There are plenty out there. Plain vanilla JSONObject fits the bill.

http://json.org

Personally I like http://flexjson.sourceforget.net it has descent performance and good feature set.

chubbsondubs
  • 37,646
  • 24
  • 106
  • 138
  • OK, thanks for your response, I will try some 3rd party plugins and find the best solution. I think I must extract it out firstly and then consider about performance. – Mr rain May 18 '12 at 03:18