Examples of JsDateJsonBeanProcessor


Examples of net.sf.json.processors.JsDateJsonBeanProcessor

import net.sf.json.JsonConfig;
import net.sf.json.processors.JsDateJsonBeanProcessor;

public class Test {
  public static void main(String[] args) {
    JsDateJsonBeanProcessor beanProcessor = new JsDateJsonBeanProcessor();
        java.sql.Date d = new java.sql.Date(System.currentTimeMillis());

        // 直接序列化
        JsonConfig config = new JsonConfig();
        JSONObject json = beanProcessor.processBean(d, config);
        System.out.println(json.toString());
       
        Vector v = new Vector();
        v.add("1");
        v.add("2");
View Full Code Here

Examples of net.sf.json.processors.JsDateJsonBeanProcessor

   * json-libĬ�ϲ�֧��java.sql.Date�����л���Ҫ���л��Լ����࣬ʵ��һ��BeanProcessor���� JSONObject
   * jsonObj = JSONObject.fromObject(row,JsonUtil.filterDate());
   */
  public static JsonConfig filterDate() {
    JsonConfig config = new JsonConfig();
    JsDateJsonBeanProcessor beanProcessor = new JsDateJsonBeanProcessor();
    config.registerJsonBeanProcessor(java.sql.Date.class, beanProcessor);
    return config;
  }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.