Examples of fromJson()


Examples of org.apache.manifoldcf.core.interfaces.Configuration.fromJSON()

  protected Configuration performAPIGetOperationViaNodes(String command, int expectedResponse)
    throws Exception
  {
    String result = performAPIGetOperation(makeAPIURL(command),expectedResponse);
    Configuration cfg = new Configuration();
    cfg.fromJSON(result);
    return cfg;
  }

  /** Perform a json DELETE API operation, using Configuration structures to represent the json.  This is for testing convenience,
  * mostly.
 
View Full Code Here

Examples of org.apache.slider.core.persist.ConfTreeSerDeser.fromJson()

                                                                                                 YarnException {
    SliderUtils.getCurrentUser();

    String payload = request.getClusterSpec();
    ConfTreeSerDeser confTreeSerDeser = new ConfTreeSerDeser();
    ConfTree updated = confTreeSerDeser.fromJson(payload);
    boolean flexed = flexCluster(updated);
    return Messages.FlexClusterResponseProto.newBuilder().setResponse(flexed).build();
  }

  @Override //SliderClusterProtocol
View Full Code Here

Examples of org.eclipse.jetty.util.ajax.JSON.Convertor.fromJSON()

                    JSON.LOG.warn(e);
                }
            }
            if (convertor!=null)
            {
                return convertor.fromJSON(object);
            }
        }
        return map;
    }
}
View Full Code Here

Examples of org.jabsorb.JSONSerializer.fromJSON()

        if (!strValue.startsWith("[")) {
          strValue = "[" + strValue + "]";
        }
        JSONSerializer serializer = new JSONSerializer();
        serializer.registerDefaultSerializers();
        Object objValue = serializer.fromJSON(strValue);
        if (objValue.getClass().isArray()) {
          arrayValue = new NSArray((Object[]) objValue);
        }
        else if (objValue instanceof Collection) {
          arrayValue = new NSArray((Collection) objValue);
View Full Code Here

Examples of org.jclouds.json.Json.fromJson()

            .build();
      assertThat(client.initiateJob(VAULT_NAME, retrieval)).isEqualTo(JOB_ID);

      RecordedRequest request = server.takeRequest();
      Json json = new GsonWrapper(new Gson());
      ArchiveRetrievalJobRequest job = json.fromJson(new String(request.getBody()), ArchiveRetrievalJobRequest.class);
      assertThat(job.getDescription()).isEqualTo(DESCRIPTION);
      assertThat(job.getRange()).isEqualTo(range);
      assertThat(job.getArchiveId()).isEqualTo(ARCHIVE_ID);
      assertThat(job.getType()).isEqualTo("archive-retrieval");
View Full Code Here

Examples of org.jclouds.json.internal.GsonWrapper.fromJson()

            .build();
      assertThat(client.initiateJob(VAULT_NAME, retrieval)).isEqualTo(JOB_ID);

      RecordedRequest request = server.takeRequest();
      Json json = new GsonWrapper(new Gson());
      ArchiveRetrievalJobRequest job = json.fromJson(new String(request.getBody()), ArchiveRetrievalJobRequest.class);
      assertThat(job.getDescription()).isEqualTo(DESCRIPTION);
      assertThat(job.getRange()).isEqualTo(range);
      assertThat(job.getArchiveId()).isEqualTo(ARCHIVE_ID);
      assertThat(job.getType()).isEqualTo("archive-retrieval");
View Full Code Here

Examples of org.joget.apps.datalist.service.DataListService.fromJson()

        // get datalist
        ApplicationContext ac = AppUtil.getApplicationContext();
        AppService appService = (AppService) ac.getBean("appService");
        DataListService dataListService = (DataListService) ac.getBean("dataListService");
        String json = AppUtil.readPluginResource(getClass().getName(), "/properties/userview/inboxMenuListJson.json", null, true, "message/userview/inboxMenu");
        DataList dataList = dataListService.fromJson(json);

        return dataList;
    }

    protected DataListCollection getRows(DataList dataList) {
View Full Code Here

Examples of org.mortbay.util.ajax.JSON.fromJSON()

        if (ext instanceof Map)
            return (Map<String,Object>)ext;
        if (ext instanceof JSON.Literal)
        {
            JSON json=_pool == null?JSON.getDefault():_pool.getMsgJSON();
            _ext=ext=json.fromJSON(ext.toString());
            super.put(Bayeux.EXT_FIELD,ext);
            return (Map<String,Object>)ext;
        }

        if (!create)
View Full Code Here

Examples of org.mortbay.util.ajax.JSON.Convertor.fromJSON()

        final Convertor wrapped = newConvertor(Reference.class);
        addConvertor(Reference.class, new Convertor()
        {
            public Object fromJSON(Map map)
            {
                return wrapped.fromJSON(map);
            }
            public void toJSON(Object obj, Output out)
            {
                getConvertor(obj.getClass(), true).toJSON(obj, out);               
            }           
View Full Code Here

Examples of org.springside.modules.mapper.JsonMapper.fromJson()

    // 使用enum.toString(), 注意配置必須在所有讀寫動作之前調用.
    // 建议toString()使用index数字属性,比enum.name()节约了空间,比enum.order()则不会有顺序随时改变不确定的问题。
    JsonMapper newMapper = new JsonMapper();
    newMapper.enableEnumUseToString();
    assertThat(newMapper.toJson(TestEnum.One)).isEqualTo("\"1\"");
    assertThat(newMapper.fromJson("\"1\"", TestEnum.class)).isEqualTo(TestEnum.One);
  }

  /**
   * 枚舉類型的演示Bean.
   */
 
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.