当前位置: 动力学知识库 > 问答 > 编程问答 >

Writing simple dictionary using java & google dictionary api

问题描述:

http://www.google.com/dictionary/json?callback=dict_api.callbacks.id100&q=test&sl=en&tl=en&restrict=pr%2Cde&client=te

(replace test with your favorite keyword)

using this i want to write simple dictionary....

problem - api give json output how i get it using java?

网友答案:

Simple Parsing Per default, JSON will just produce a nested graph of maps and lists. Here is an example of default parsing:

import org.svenson.JSONParser;

// assume json to be a JSON datasets as String

Object o = JSONParser.defaultJSONParser().parse(json);

o will now contain either a map or a list instance, depending on whether the first symbol in the JSON is '{' or '['.

分享给朋友:
您可能感兴趣的文章:
随机阅读: