seven.ExcelFactory Maven / Gradle / Ivy
Show all versions of ExcelReads Show documentation
package seven;
import seven.callBack.PackageDataInterface;
import seven.savewapper.SaveExcel;
import seven.savewapper.wapperRef.sysWppers.ResExportDBMap;
import seven.savewapper.wapperRef.sysWppers.ResExportDBObj;
import seven.savewapper.wapperRef.sysWppers.ResExportMap;
import seven.savewapper.wapperRef.sysWppers.ResExportObj;
import seven.wapperInt.Wrapper;
import seven.wapperInt.wapperRef.WrapperObj;
import java.sql.ResultSet;
import java.util.List;
import java.util.Map;
//=======================================================
// .----.
// _.'__ `.
// .--(^)(^^)---/#\
// .' @ /###\
// : , #####
// `-..__.-' _.-\###/
// `;_: `"'
// .'"""""`.
// /, ya ,\\
// //狗神保佑 \\
// `-._______.-'
// ___`. | .'___
// (______|______)
//=======================================================
/**
* @author Seven
* date 2016年6月4日-下午4:08:19
*/
@SuppressWarnings("all")
public class ExcelFactory {
private ExcelFactory() {
}
/**
* 读取Excel
* @param FilePath 路径
* @param r 包装类
* @return Wrapper
* @throws Exception
*/
public static Wrapper getBeans(String FilePath, WrapperObj r) throws Exception {
return r.init(FilePath);
}
/**
* 保存Excel
*
* @param bean
* @param FilePath
* @return SaveExcel
* @throws Exception
*/
public static SaveExcel saveExcel(List extends T> bean, String FilePath) throws Exception {
if (bean.size() < 1) {
throw new Exception("请传入数据");
}
if (bean.get(0) instanceof Map) {
return (SaveExcel) new ResExportMap((List