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


Java UnknownServerColumnException类代码示例

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


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

示例1: uploadData

import com.belladati.sdk.exception.dataset.data.UnknownServerColumnException; //导入依赖的package包/类
@Override
public void uploadData(String id, DataTable data) {
	List<DataRow> rows = data.getRows();
	if (rows.size() == 0) {
		// if we don't have data, do nothing
		return;
	}
	try {
		client.postUpload("api/import/" + id, tokenHolder, data.toJson().toString());
	} catch (UnexpectedResponseException e) {
		if (e.getResponseCode() == 400) {
			Pattern codePattern = Pattern.compile(".*?'(.*?)'.*");
			Matcher codeMatcher = codePattern.matcher(e.getResponseContent());
			if (codeMatcher.matches()) {
				throw new UnknownServerColumnException(id, codeMatcher.group(1));
			}
		}
		throw new UnexpectedResponseException(e.getResponseCode(), e.getResponseContent(), e);
	}
}
 
开发者ID:BellaDati,项目名称:belladati-sdk-java,代码行数:21,代码来源:BellaDatiServiceImpl.java

示例2: nonExistingColumn

import com.belladati.sdk.exception.dataset.data.UnknownServerColumnException; //导入依赖的package包/类
/** non-existing column server error */
public void nonExistingColumn() {
	server.registerError(url, 400, "Indicator/attribute '" + column + "' doesn't exist");

	try {
		getService().uploadData(id, DataTable.createBasicInstance(column).createRow("content"));
		fail("No exception thrown");
	} catch (UnknownServerColumnException e) {
		assertEquals(e.getId(), id);
		assertEquals(e.getColumn(), column);
	}
}
 
开发者ID:BellaDati,项目名称:belladati-sdk-java,代码行数:13,代码来源:DataImportTest.java

示例3: nonExistingColumn

import com.belladati.sdk.exception.dataset.data.UnknownServerColumnException; //导入依赖的package包/类
/** non-existing column server error */
public void nonExistingColumn() {
	server.registerError(url, 400, "Indicator/attribute '" + column + "' doesn't exist");

	try {
		service.uploadData(id, DataTable.createBasicInstance(column).createRow("content"));
		fail("No exception thrown");
	} catch (UnknownServerColumnException e) {
		assertEquals(e.getId(), id);
		assertEquals(e.getColumn(), column);
	}
}
 
开发者ID:BellaDati,项目名称:belladati-sdk-android,代码行数:13,代码来源:DataImportTest.java

示例4: uploadData

import com.belladati.sdk.exception.dataset.data.UnknownServerColumnException; //导入依赖的package包/类
/**
 * Uploads the given data into this data set. This method doesn't perform
 * any validation of the data; the caller should ensure it matches the data
 * set's structure.
 * <p>
 * To ensure the structure is correct, generate the table calling
 * {@link #createDataTable()} on the same data set.
 * 
 * @param data the data to upload
 * @return this data set
 * @throws UnknownServerColumnException if the data table contains a column
 *             that doesn't exist in the data set
 */
DataSet uploadData(DataTable data) throws UnknownServerColumnException;
 
开发者ID:BellaDati,项目名称:belladati-sdk-api,代码行数:15,代码来源:DataSet.java

示例5: uploadData

import com.belladati.sdk.exception.dataset.data.UnknownServerColumnException; //导入依赖的package包/类
/**
 * Uploads the given data into this data set. This method doesn't perform
 * any validation of the data; the caller should ensure it matches the data
 * set's structure.
 * 
 * @param id ID of the data set to upload to
 * @param data the data to upload
 * @throws UnknownServerColumnException if the data table contains a column
 *             that doesn't exist in the data set
 * @see <a href="http://support.belladati.com/techdoc/POST+JSON+data">POST JSON data</a>
 */
void uploadData(String id, DataTable data) throws UnknownServerColumnException;
 
开发者ID:BellaDati,项目名称:belladati-sdk-api,代码行数:13,代码来源:BellaDatiService.java


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