com.clickntap.api.JsonBeanManagerImpl Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of click_framework Show documentation
Show all versions of click_framework Show documentation
Java Framework based on Spring Framework, Freemarker and Simplicity
package com.clickntap.api;
import java.util.List;
import org.apache.commons.lang.StringUtils;
import com.clickntap.tool.bean.Bean;
import com.clickntap.tool.bean.BeanManagerImpl;
public class JsonBeanManagerImpl extends BeanManagerImpl implements JsonBeanManager {
public JsonBeanManagerImpl() throws Exception {
super();
}
public String readAsJson(Number id, Class clazz) throws Exception {
Bean bean = read(id, clazz);
return JsonUtils.beanToJson(bean);
}
public String readListAsJsonByFilter(Class clazz, String filter, String what) throws Exception {
List ids = readListByFilter(clazz, JsonUtils.jsonToBean(filter), what);
return StringUtils.join(ids.toArray(), ",");
}
}
© 2015 - 2024 Weber Informatics LLC | Privacy Policy