Examples of toJSON()


Examples of com.orientechnologies.orient.core.record.impl.ODocument.toJSON()

    final ArrayList<ODocument> list = new ArrayList<ODocument>();
    newDoc.field("embeddedList", list, OType.EMBEDDEDLIST);
    list.add(new ODocument().field("name", "Luca"));
    list.add(new ODocument().field("name", "Marcus"));

    String json = newDoc.toJSON();
    ODocument loadedDoc = new ODocument().fromJSON(json);

    Assert.assertTrue(newDoc.hasSameContentOf(loadedDoc));

    Assert.assertTrue(loadedDoc.containsField("embeddedList"));
View Full Code Here

Examples of com.sdicons.json.mapper.helper.impl.ObjectMapper.toJSON()

    }

    @Override
    public JSONValue toJSON(Object aPojo) throws MapperException {
  ObjectMapper objectMapper = new ObjectMapper();
  return objectMapper.toJSON(aPojo);
    }

}
View Full Code Here

Examples of com.skaringa.javaxml.serializers.ComponentSerializer.toJson()

      output = new PrintStream(new BufferedOutputStream(stream), false, "UTF-8");
    } catch (UnsupportedEncodingException e) {
      throw new RuntimeException(e); // UTF-8 should always be supported
    }

    ser.toJson(obj, type, _properties, output);

    output.flush();
    Log.info("toJson - end "
        + (obj != null ? obj.getClass().getName() : "null"));
  }
View Full Code Here

Examples of com.sonyericsson.hudson.plugins.metadata.model.values.TreeNodeMetadataValue.toJson()

        StringMetadataValue metadataValue = new StringMetadataValue("owner", "bobby");
        TreeNodeMetadataValue node = new TreeNodeMetadataValue("container",
                Collections.<MetadataValue>singletonList(metadataValue));

        JSONObject jsonObject = node.toJson();

        when(request.getParameter(eq("job"))).thenReturn(job);
        PowerMockito.when(CliUtils.getContainer(null, job, null, false)).thenReturn(container);
        when(container.toJson()).thenReturn(jsonObject);
View Full Code Here

Examples of com.steeplesoft.frenchpress.model.MediaItem.toJson()

    @GET
    @Path("/id/{id}/")
    public Response getItem(@PathParam("id") Long id) {
        final MediaItem item = service.getItem(id);
        final JsonObject json = item.toJson()
                .add("_ref", uriInfo.getAbsolutePathBuilder().build().toString())
                .build();
        return Response.ok(json).build();
    }
View Full Code Here

Examples of com.taobao.metamorphosis.cluster.json.TopicBroker.toJson()

        log.info("Register broker for topic:" + topicBroker);
        // Be compatible with the version before 1.4.3
        ZkUtils.createEphemeralPath(this.zkClient, brokerTopicPath, String.valueOf(numParts));

        // added by dennis,since 1.4.3
        String topicBrokerJson = topicBroker.toJson();
        if (topicConfig.isAcceptPublish()) {
            ZkUtils.createEphemeralPath(this.zkClient, topicPubPath, topicBrokerJson);
        }
        else {
            ZkUtils.deletePath(this.zkClient, topicPubPath);
View Full Code Here

Examples of com.threepillar.labs.si.aws.MessagePacket.toJSON()

  public Object executeOutboundOperation(final Message<?> message) {

    MessagePacket packet = new MessagePacket(message);
    if (queue == null) {
      SendMessageRequest request = new SendMessageRequest(queueUrl,
          packet.toJSON());
      SendMessageResult result = sqsClient.sendMessage(request);
      log.debug("Message sent, Id:" + result.getMessageId());
    } else {
      queue.add(packet.toJSON());
    }
View Full Code Here

Examples of com.vaynberg.wicket.select2.json.JsonBuilder.toJson()

    selection.endObject();
      } catch (JSONException e) {
    throw new RuntimeException("Error converting model object to Json", e);
      }
      response.render(OnDomReadyHeaderItem.forScript(JQuery.execute("$('#%s').select2('data', %s);",
        getJquerySafeMarkupId(), selection.toJson())));
  }
    }
}
View Full Code Here

Examples of com.voyagegames.java.tracking.AppEvent.toJSON()

    assertTrue(!callback.errorCalled);
    assertTrue(null == callback.output);
    assertTrue(disp.dispatch(acc));
    assertTrue(null != callback.output);
   
    final String output = "{\"data\":[" + event.toJSON() + "]}";
    assertTrue(output.length() > callback.output.length);
  }

  @Test
  public void testDispatchIAccumulator_noCompression() {
View Full Code Here

Examples of edu.indiana.dlib.metsnav.config.CollectionConfig.toJson()

        if (config == null) {
            // TODO return an error message
            return "";
        } else {
            if (StringUtils.isBlank(callback)) {
                return config.toJson().toString();
            } else {
                return callback + "(" + config.toJson().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.