Examples of registerJsonValueProcessor()


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

    scriptVO.setAllowedTemplates(allowedTemplateIdsList);
    scriptVO.setActionIds(actionIdsList);
    scriptVO.setStatIds(statIdsList);
   
    JsonConfig config = new JsonConfig()
        config.registerJsonValueProcessor(Timestamp.class, new DateJsonValueProcessor());
        JSONObject json = JSONObject.fromObject(scriptVO,config);
        return json.toString();
  }
 
  /**
 
View Full Code Here

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

  @RequestMapping("/getAllScript.do")
  @ResponseBody
  public String getAllScript() throws Exception {
    List<Script> scripts = das.queryAllScripts();
    JsonConfig config = new JsonConfig()
        config.registerJsonValueProcessor(Timestamp.class, new DateJsonValueProcessor());
    JSONArray json = JSONArray.fromObject(scripts,config);
    return json.toString();
  }
 
  @RequestMapping("/initTemplateActionAndStat.do")
View Full Code Here

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

         * Renders HTTP response.
         */
        public void generateResponse(StaplerRequest req, StaplerResponse rsp, Object node) throws IOException, ServletException {
            // Date needs to be converted into iso-8601 date format.
            JsonConfig config = new JsonConfig();
            config.registerJsonValueProcessor(Date.class, new JsonValueProcessor() {

                public synchronized Object processArrayValue(Object value, JsonConfig jsonConfig) {
                    if (value != null){
                       DateFormat dateFormat = new SimpleDateFormat("MMM dd yyyy HH:mm:ss 'GMT'Z", Functions.getClientLocale());
                       return dateFormat.format(value);
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.