Package flexjson

Examples of flexjson.JSONSerializer


    public static String toJsonArray(Collection<Todo> collection) {
        return new JSONSerializer().exclude("*.class").transform(new DateTransformer("MM/dd/yyyy"), Date.class).serialize(collection);
    }

    public static String toJsonArray(Collection<Todo> collection, String[] fields) {
        return new JSONSerializer().include(fields).exclude("*.class").serialize(collection);
    }
View Full Code Here


                return "file not found!";
            }
        }
        else if (propertyName.equals(TOKEN_MAP))
        {
            return new JSONSerializer().serialize(storageService.getStringEndpointMap());
        }
        else if (propertyName.equals("version"))
        {
            return Constants.VERSION;
        }
View Full Code Here

          + graph.get(0).getAdjacencies().size());
    } catch (Exception e) {
      log.error(e.getMessage(), new ServletException(e));
    }

    JSONSerializer serializer = new JSONSerializer();
    serializer.exclude("class").exclude("adjacencies.class")
        .exclude("adjacencies.data.class").exclude("adjacencies.src").exclude("adjacencies.data.relation").exclude("data.class").exclude("data.profile")
        .deepSerialize(graph, resp.getWriter());
    return;
  }
View Full Code Here

        catch (Exception e)
        {
            log.error(e.getMessage(), new ServletException(e));
        }

        JSONSerializer serializer = new JSONSerializer();
        serializer.exclude("class").exclude("adjacencies.class")
                .exclude("adjacencies.data.class").exclude("adjacencies.src")
                .exclude("adjacencies.data.relation").exclude("adjacencies.data.color").exclude("data.class")
                .exclude("data.profile").exclude("data.color").deepSerialize(graph, resp.getWriter());
        return;
    }
View Full Code Here

    }

    private void returnJSON(HttpServletResponse response,
            List<EPersonDTO> epersons) throws IOException
    {       
        JSONSerializer serializer = new JSONSerializer();
        serializer.rootName("epersons");
        serializer.exclude("class");
        response.setContentType("application/json");
        serializer.deepSerialize(epersons, response.getWriter());
    }
View Full Code Here

        {
            info.setActive(rp.getStatus() != null ? rp.getStatus() : false);
            info.setUrl("/cris/" + rp.getPublicPath() + "/"
                    + ResearcherPageUtils.getPersistentIdentifier(rp));
        }
        JSONSerializer serializer = new JSONSerializer();
        serializer.rootName("myrp");
        serializer.exclude("class");
        response.setContentType("application/json");
        serializer.deepSerialize(info, response.getWriter());
    }
View Full Code Here

        Response resp = new Response();
        resp.setRelatedObjects(relatedObjects.getObjects());
        resp.setiTotalRecords(relatedObjects.getTotalRecords());
        resp.setiTotalDisplayRecords(relatedObjects.getFilterRecords());
        resp.setsEcho(sEcho);
        JSONSerializer serializer = new JSONSerializer();
        serializer.exclude("class", "objects.class");
        serializer.deepSerialize(resp, response.getWriter());
        response.setContentType("application/json");
        return null;
    }
View Full Code Here

                return "file not found!";
            }
        }
        else if (propertyName.equals(TOKEN_MAP))
        {
            return new JSONSerializer().serialize(storageService.getStringEndpointMap());
        }
        else if (propertyName.equals("version"))
        {
            return Constants.VERSION;
        }
View Full Code Here

                return "file not found!";
            }
        }
        else if (propertyName.equals(TOKEN_MAP))
        {
            return new JSONSerializer().serialize(storageService.getStringEndpointMap());
        }
        else if (propertyName.equals("version"))
        {
            return Constants.VERSION;
        }
View Full Code Here

  public void setLikeNum(int likeNum) {
    this.likeNum = likeNum;
  }

  public String toJson() {
    return new JSONSerializer().exclude("*.class").deepSerialize(this);
  }
 
View Full Code Here

TOP

Related Classes of flexjson.JSONSerializer

Copyright © 2018 www.massapicom. 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.