将带有jxquery注释的java bean转换为JSON字符串

时间:2015-02-06 14:49:46

标签: java json converter javabeans

如何将使用jxQuery注释构建的java bean转换回JSON字符串?

例如我有数据bean:

import com.googlecode.jxquery.jxQuery;

public class TestBean {

@jxQuery(query = "/client/can_use_day_budget")
private String canUseDayBudget;

@jxQuery(query =  "/validEmails/email")
private List<String> emails;

//getters and setters 
}

我想从中获取json字符串:

{ "validEmails":[{"email":"email1@gmail.com","select":""},{"email":"email2@gmail.com","select":""}],"client":{"can_use_day_budget":0}}

谢谢。

0 个答案:

没有答案