当前位置: 首页>>代码示例>>Java>>正文


Java ParseException类代码示例

本文整理汇总了Java中com.eclipsesource.json.ParseException的典型用法代码示例。如果您正苦于以下问题:Java ParseException类的具体用法?Java ParseException怎么用?Java ParseException使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


ParseException类属于com.eclipsesource.json包,在下文中一共展示了ParseException类的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: executeCommandAndGetJsonValue

import com.eclipsesource.json.ParseException; //导入依赖的package包/类
private JsonValue executeCommandAndGetJsonValue(String command1, String command2, String command3)
	throws WalletCallException, IOException, InterruptedException
{
	String strResponse = this.executeCommandAndGetSingleStringResponse(command1, command2, command3);

	JsonValue response = null;
	try
	{
	  	response = Json.parse(strResponse);
	} catch (ParseException pe)
	{
	  	throw new WalletCallException(strResponse + "\n" + pe.getMessage() + "\n", pe);
	}

	return response;
}
 
开发者ID:ZencashOfficial,项目名称:zencash-swing-wallet-ui,代码行数:17,代码来源:ZCashClientCaller.java

示例2: ProxyJSONConfigParser

import com.eclipsesource.json.ParseException; //导入依赖的package包/类
public ProxyJSONConfigParser(final String file) throws IOException, JSONConfigException {
    final String content = new String(Files.readAllBytes(Paths.get(file)));
    try {
        this.jsonObject = Json.parse(content).asObject();
    } catch (final ParseException | UnsupportedOperationException e) {
        throw new JSONConfigException("JSON Syntax Error");
    }
}
 
开发者ID:dragonite-network,项目名称:dragonite-java,代码行数:9,代码来源:ProxyJSONConfigParser.java

示例3: testCreateTermsOfServiceUserStatusInfoParseAllFieldsCorrectly

import com.eclipsesource.json.ParseException; //导入依赖的package包/类
@Test
@Category(UnitTest.class)
public void testCreateTermsOfServiceUserStatusInfoParseAllFieldsCorrectly() throws ParseException {
    final String type = "terms_of_service_user_status";
    final String statusID = "1939280";
    final String tosID = "2778";

    final JsonObject fakeJSONResponse = JsonObject.readFrom("{\n"
            + "    \"type\": \"terms_of_service_user_status\",\n"
            + "    \"id\": \"1939280\",\n"
            + "    \"tos\": {\n"
            + "        \"type\": \"terms_of_service\",\n"
            + "        \"id\": \"2778\"\n"
            + "    },\n"
            + "    \"user\": {\n"
            + "        \"type\": \"user\",\n"
            + "        \"id\": \"11111\"\n"
            + "    },\n"
            + "    \"is_accepted\": true,\n"
            + "    \"created_at\": \"2013-05-16T15:27:57-07:00\",\n"
            + "    \"modified_at\": \"2013-05-16T15:27:57-07:00\"\n"
            + "}");
    BoxAPIConnection api = new BoxAPIConnection("");
    api.setRequestInterceptor(JSONRequestInterceptor.respondWith(fakeJSONResponse));

    BoxTermsOfServiceUserStatus.Info tosUserStatusInfo = BoxTermsOfServiceUserStatus.create(api, tosID, true);
    Assert.assertEquals(tosID, tosUserStatusInfo.getTermsOfService().getID());
    Assert.assertEquals(statusID, tosUserStatusInfo.getID());
    Assert.assertEquals(type, tosUserStatusInfo.getType());
}
 
开发者ID:box,项目名称:box-java-sdk,代码行数:31,代码来源:BoxTermsOfServiceUserStatusTest.java

示例4: result

import com.eclipsesource.json.ParseException; //导入依赖的package包/类
void result(String data) throws ParseException {
    JsonArray res = Json.parse(data).asObject().get("results").asArray();
    Vector<Address> r = new Vector<Address>();
    for (int i = 0; i < res.size(); i++) {
        JsonObject o = res.get(i).asObject();
        Address addr = new Address();
        addr.address = o.get("formatted_address").asString();
        JsonObject geo = o.get("geometry").asObject().get("location").asObject();
        addr.lat = geo.get("lat").asDouble();
        addr.lon = geo.get("lng").asDouble();
        r.add(addr);
    }
    result(r);
}
 
开发者ID:shutoff,项目名称:cg_starter,代码行数:15,代码来源:SearchActivity.java

示例5: testGetProActiveServerVersionStatusCode200InvalidPayload

import com.eclipsesource.json.ParseException; //导入依赖的package包/类
@Test(expected = ParseException.class)
public void testGetProActiveServerVersionStatusCode200InvalidPayload() throws IOException {
    testGetProActiveServerVersion(200, "Abracadabra", false);
}
 
开发者ID:ow2-proactive,项目名称:scheduling,代码行数:5,代码来源:ProActiveVersionUtilityTest.java

示例6: mockParseException

import com.eclipsesource.json.ParseException; //导入依赖的package包/类
@Test
public void mockParseException() {
  Mockito.mock(ParseException.class);
}
 
开发者ID:ralfstx,项目名称:minimal-json,代码行数:5,代码来源:Mocking_Test.java

示例7: processModFile

import com.eclipsesource.json.ParseException; //导入依赖的package包/类
private static Set<Archive> processModFile(final Path path, final SettingsModelFactory settingsFactory) throws IOException, StarDBException, ParseException {
	
	Set<Archive> archives = new HashSet<>();
	
	if (FileHelper.identifyType(path, false).equals("pak")) {
		processPakFile(path, archives, settingsFactory);
	} else {
		processArchive(path, archives, settingsFactory);
	}
	
	return archives;
	
}
 
开发者ID:KrazyTheFox,项目名称:Starbound-Mod-Manager,代码行数:14,代码来源:Mod.java


注:本文中的com.eclipsesource.json.ParseException类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。