DatasourceServletAction.java 文件源码

java
阅读 19 收藏 0 点赞 0 评论 0

项目:ureport 作者:
public void buildClass(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
    String clazz=req.getParameter("clazz");
    List<Field> result=new ArrayList<Field>();
    try{
        Class<?> targetClass=Class.forName(clazz);
        PropertyDescriptor[] propertyDescriptors=PropertyUtils.getPropertyDescriptors(targetClass);
        for(PropertyDescriptor pd:propertyDescriptors){
            String name=pd.getName();
            if("class".equals(name)){
                continue;
            }
            result.add(new Field(name));
        }
        writeObjectToJson(resp, result);
    }catch(Exception ex){
        throw new ReportDesignException(ex);
    }
}
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号