Examples of registerJsonValueProcessor()


Examples of net.sf.json.JsonConfig.registerJsonValueProcessor()

  }

  public String toJson() {
    JsonConfig jsonConfig = JsonConfigFactory.createJsonConfig(this.content);
   
    jsonConfig.registerJsonValueProcessor(Date.class,new DateJsonValueProcessor());
    jsonConfig.registerJsonValueProcessor(Timestamp.class,new DateJsonValueProcessor())

    JsonConfigFactory.filteExcludes(this, jsonConfig);
    return JSONObject.fromObject(this,
        jsonConfig).toString();
View Full Code Here

Examples of net.sf.json.JsonConfig.registerJsonValueProcessor()

  public String toJson() {
    JsonConfig jsonConfig = JsonConfigFactory.createJsonConfig(this.content);
   
    jsonConfig.registerJsonValueProcessor(Date.class,new DateJsonValueProcessor());
    jsonConfig.registerJsonValueProcessor(Timestamp.class,new DateJsonValueProcessor())

    JsonConfigFactory.filteExcludes(this, jsonConfig);
    return JSONObject.fromObject(this,
        jsonConfig).toString();
  }
View Full Code Here

Examples of net.sf.json.JsonConfig.registerJsonValueProcessor()

    public JSON _toJson(Object obj) {
        JsonConfig config = new JsonConfig();
        config.setIgnoreDefaultExcludes(false);
        config.setCycleDetectionStrategy(CycleDetectionStrategy.LENIENT);
        config.registerJsonValueProcessor(Date.class, new DateJsonValueProcessor());
        if (obj instanceof Collection) {
            return JSONArray.fromObject(obj, config);
        }
        return JSONObject.fromObject(obj, config);
    }
View Full Code Here

Examples of net.sf.json.JsonConfig.registerJsonValueProcessor()

      currentUserName = UserUtil.getCurrentUserName(request);
      FinanceMoneyDetail financeMoneyDetail = (FinanceMoneyDetail) getBaseManager().get(FinanceMoneyDetail.class,
          financeMoneyDetailId);
      JsonConfig config = new JsonConfig();
      // 注册日期解析器
      config.registerJsonValueProcessor(java.sql.Date.class, new JsonDateToStringProcessorImpl());
      config.registerJsonValueProcessor(java.util.Date.class, new JsonDateToStringProcessorImpl());
      config.registerJsonValueProcessor(java.sql.Timestamp.class, new JsonDateToStringProcessorImpl());
      // 忽略父子级别关联
      config.setJsonPropertyFilter(new PropertyFilter() {
        public boolean apply(Object source, String name, Object value) {
View Full Code Here

Examples of net.sf.json.JsonConfig.registerJsonValueProcessor()

      FinanceMoneyDetail financeMoneyDetail = (FinanceMoneyDetail) getBaseManager().get(FinanceMoneyDetail.class,
          financeMoneyDetailId);
      JsonConfig config = new JsonConfig();
      // 注册日期解析器
      config.registerJsonValueProcessor(java.sql.Date.class, new JsonDateToStringProcessorImpl());
      config.registerJsonValueProcessor(java.util.Date.class, new JsonDateToStringProcessorImpl());
      config.registerJsonValueProcessor(java.sql.Timestamp.class, new JsonDateToStringProcessorImpl());
      // 忽略父子级别关联
      config.setJsonPropertyFilter(new PropertyFilter() {
        public boolean apply(Object source, String name, Object value) {
          if (name.equals("parentGroup") || name.equals("childGroups")) {
View Full Code Here

Examples of net.sf.json.JsonConfig.registerJsonValueProcessor()

          financeMoneyDetailId);
      JsonConfig config = new JsonConfig();
      // 注册日期解析器
      config.registerJsonValueProcessor(java.sql.Date.class, new JsonDateToStringProcessorImpl());
      config.registerJsonValueProcessor(java.util.Date.class, new JsonDateToStringProcessorImpl());
      config.registerJsonValueProcessor(java.sql.Timestamp.class, new JsonDateToStringProcessorImpl());
      // 忽略父子级别关联
      config.setJsonPropertyFilter(new PropertyFilter() {
        public boolean apply(Object source, String name, Object value) {
          if (name.equals("parentGroup") || name.equals("childGroups")) {
            return true;
View Full Code Here

Examples of net.sf.json.JsonConfig.registerJsonValueProcessor()

    Long iouserId = StringUtil.getLongValue(request, "id");
    String currentUserName = null;
    try {
      currentUserName = UserUtil.getCurrentUserName(request);
      JsonConfig config = new JsonConfig();
      config.registerJsonValueProcessor(java.sql.Timestamp.class, new JsonDateToStringProcessorImpl());
      config.setJsonPropertyFilter(new PropertyFilter(){
        public boolean apply(Object source, String name, Object value) {
          if(name.equals("parentGroup") || name.equals("childGroups")) {
            return true;
          } else {
View Full Code Here

Examples of net.sf.json.JsonConfig.registerJsonValueProcessor()

    Long groupId = StringUtil.getLongValue(request, "id");
    String currentUserName = null;
    try {
      currentUserName = UserUtil.getCurrentUserName(request);
      JsonConfig config = new JsonConfig();
      config.registerJsonValueProcessor(java.sql.Timestamp.class, new JsonDateToStringProcessorImpl());
      config.setJsonPropertyFilter(new PropertyFilter(){
        public boolean apply(Object source, String name, Object value) {
          if(name.equals("parentGroup") || name.equals("childGroups")) {
            return true;
          } else {
View Full Code Here

Examples of net.sf.json.JsonConfig.registerJsonValueProcessor()

    public static JsonConfig configJson(String datePattern) {   
        JsonConfig jsonConfig = new JsonConfig();   
        jsonConfig.setExcludes(new String[] { "" });   
        jsonConfig.setIgnoreDefaultExcludes(false);   
        jsonConfig.setCycleDetectionStrategy(CycleDetectionStrategy.LENIENT);   
        jsonConfig.registerJsonValueProcessor(Date.class,   
                new JsonDateValueProcessor(datePattern));   
  
        return jsonConfig;   
    }   
View Full Code Here

Examples of net.sf.json.JsonConfig.registerJsonValueProcessor()

    return json;
  }

  public static JsonConfig filterDateConfig() {
    JsonConfig cfg = new JsonConfig();
    cfg.registerJsonValueProcessor(java.util.Date.class,
        new JsonValueProcessor() {
          private final String format = "yyyy-MM-dd HH:mm:ss";

          public Object processObjectValue(String key, Object value,
              JsonConfig arg2) {
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.