Examples of JSONSerializer


Examples of org.neo4j.smack.serialization.JsonSerializer

    @Test
    public void shouldSerializeNodeWithNoProperties() {
       
        ByteArrayOutputStream buffer = new ByteArrayOutputStream();
        JsonSerializer serializer = new JsonSerializer(new JsonFactory(), buffer);
       
        Node mockNode = mock(Node.class);
        when(mockNode.getId()).thenReturn(0l);
        when(mockNode.getPropertyKeys()).thenReturn(Collections.<String> emptyList());
       
        NodeSerializationStrategy strategy = new NodeSerializationStrategy();
        strategy.serialize(mockNode, serializer);
        serializer.flush();
       
        assertThat(new String(buffer.toByteArray()),is("{" +
                "\"data\":{}," +
                "\"self\":\"/db/data/node/0\"," +
                "\"extensions\":{}" +
View Full Code Here

Examples of org.persvr.remote.JSONSerializer

          Scriptable thisObj, Object[] args) {
        try {         
          HttpServletResponse response = Client.getCurrentObjectResponse().getHttpResponse();
          response.setContentType("application/json; locator=id; charset=UTF-8");
          Writer writer = new OutputStreamWriter(response.getOutputStream(),"UTF8");
          new JSONSerializer().serialize(args[0], Client.getCurrentObjectResponse(), writer);
          writer.flush();
          return null;
        } catch (IOException e) {
          throw new RuntimeException(e);
        }
View Full Code Here

Examples of org.reflections.serializers.JsonSerializer

                .setUrls(asList(ClasspathHelper.forClass(TestModel.class)))
                .filterInputsBy(TestModelFilter)
                .setScanners(
                        new MethodParameterScanner()));

        final JsonSerializer serializer = new JsonSerializer();
        ref.save(getUserDir() + "/target/test-classes" + "/META-INF/reflections/testModel-reflections.json", serializer);

        reflections = Reflections
                .collect()
                .merge(Reflections.collect("META-INF/reflections",
View Full Code Here

Examples of org.vraptor.remote.json.JSONSerializer

            if (!method.getMethod().isAnnotationPresent(Remotable.class)) {
                throw new InterceptionException("Unable to make an ajax result in a non-remotable method.");
            }
            int depth = method.getMethod().getAnnotation(Remotable.class).depth();
            JsonOutjecter outjecter = (JsonOutjecter) info.getOutjecter();
            CharSequence output = new JSONSerializer(depth).serialize(outjecter.contents());
            response.setCharacterEncoding(UTF8);
            response.setContentType("application/json");

            try {
                PrintWriter writer = response.getWriter();
View Full Code Here

Examples of pivot.serialization.JSONSerializer

        InputStream in = getClass().getClassLoader().getResourceAsStream(name);
        if (in == null) {
            return null;
        }

        JSONSerializer serializer = new JSONSerializer(charset);
        Map<String, Object> resourceMap = null;
        try {
            resourceMap = (Map<String, Object>) serializer.readObject(in);
        } finally {
            in.close();
        }

        return resourceMap;
View Full Code Here

Examples of rocket.json.client.JsonSerializer

    return this.getUrl();
  }

  @Override
  String getRequestData() {
    final JsonSerializer serializer = this.createSerializer();
    final JSONValue json = serializer.writeJson(this.getParameter());
    return json.toString();
  }
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.