All Downloads are FREE. Search and download functionalities are using the official Maven repository.

ars.database.service.ExcelAdapter Maven / Gradle / Ivy

package ars.database.service;

import org.apache.poi.ss.usermodel.Row;

import ars.invoke.request.Requester;
import ars.database.service.Service;

/**
 * Excel数据对象适配接口
 * 
 * @author yongqiangwu
 * 
 * @param 
 *            数据模型
 */
public interface ExcelAdapter {
	/**
	 * 开始适配
	 * 
	 * @param requester
	 *            请求对象
	 * @param service
	 *            业务操作对象
	 */
	public void begin(Requester requester, Service service);

	/**
	 * 获取标题
	 * 
	 * @param requester
	 *            请求对象
	 * @param service
	 *            业务操作对象
	 * @return 标题数组
	 */
	public String[] getTitles(Requester requester, Service service);

	/**
	 * 读取Excel数据行并转换成对象实体
	 * 
	 * @param requester
	 *            请求对象
	 * @param service
	 *            业务操作对象
	 * @param row
	 *            数据行对象
	 * @return 对象实体
	 */
	public T read(Requester requester, Service service, Row row);

	/**
	 * 将对象实体写入到Excel数据行
	 * 
	 * @param requester
	 *            请求对象
	 * @param service
	 *            业务操作对象
	 * @param entity
	 *            对象实体
	 * @param row
	 *            数据行对象
	 */
	public void write(Requester requester, Service service, T entity, Row row);

	/**
	 * 完成适配
	 * 
	 * @param requester
	 *            请求对象
	 * @param service
	 *            业务操作对象
	 */
	public void complete(Requester requester, Service service);

}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy