Package flexjson

Examples of flexjson.JSONSerializer.serialize()


        // set arguments
        if (arguments != null) {
            JSONSerializer serializer = new JSONSerializer();

            OverrideService.getInstance().updateArguments(overrideId, identifiers.getPathId(), ordinal, serializer.serialize(httpRequest.getParameterValues("arguments[]")), clientUUID);
        }

        // set repeat number
        if (repeatNumber != null) {
            OverrideService.getInstance().updateRepeatNumber(overrideId, identifiers.getPathId(), ordinal, repeatNumber, clientUUID);
View Full Code Here


          Blob polesB=tuple.getBlob(tupleMetadata,POLES);
        response.setZeros(zerosB.getBytes(1, (int) zerosB.length()));
          response.setPoles(polesB.getBytes(1, (int) polesB.length()));
      responses.add(response);
      JSONSerializer serializer = new JSONSerializer();
      parametersMap.put("response"+i, URLEncoder.encode(serializer.serialize(response),"UTF-8"));
      i++;
       }
    //   String homePath=mResource.getHomeDirectory().getAbsolutePath();
      //fileName=homePath+"/"+fileName;
    //   if(fileName!=null&&!"".equals(fileName))
View Full Code Here

   */
  public void store(Item item, String alias) {
    if (initialized) {
      JSONSerializer serializer =
        new JSONSerializer().transform(new SenseEventTransformer(), SenseEventBean.class);
      String serializedBean = serializer.serialize(new SenseEventBean(alias, item.getState().toString()));
     
      String serviceUrl = url + apiKey;
      String response = HttpUtil.executeUrl(
        "POST", serviceUrl, IOUtils.toInputStream(serializedBean), "application/json", 5000);
      logger.debug("Stored item '{}' as '{}' in Sen.se and received response: {} ", new String[] { item.getName(), alias, response });
View Full Code Here

              httpCon.setRequestProperty("X-ApiKey",apiKey);
              OutputStreamWriter out = new OutputStreamWriter(httpCon.getOutputStream());

        JSONSerializer serializer =
          new JSONSerializer().transform(new CosmEventTransformer(), CosmEventBean.class);
        String serializedBean = serializer.serialize(new CosmEventBean(alias, item.getState().toString()));

              out.write(serializedBean);
              out.flush();
        logger.debug("Stored item '{}' as '{}' in Cosm and received response: {} ", new String[] { item.getName(), alias, httpCon.getResponseMessage() });
              out.close();
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.