@@ -0,0 +1,917 @@
+package org.onetwo.common.excel;%0A%0Aimport java.util.List;%0Aimport java.util.Map;%0A%0Aimport org.apache.poi.ss.usermodel.Sheet;%0Aimport org.onetwo.common.exception.BaseException;%0Aimport org.onetwo.common.utils.LangUtils;%0A%0Apublic class MapedBeanRowMapper%3CT%3E extends BeanRowMapper%3CT%3E %7B%0A%0A%09private Map%3CString, String%3E nameMap = LangUtils.newHashMap();%0A%09%0A%09public MapedBeanRowMapper(Class%3CT%3E clazz) %7B%0A%09%09super(clazz, WorkbookReaderFactory.convertors);%0A%09%7D%0A%0A%09public MapedBeanRowMapper%3C?%3E map(String name, String propertyName)%7B%0A%09%09this.nameMap.put(name, propertyName);%0A%09%09return this;%0A%09%7D%0A%09public List%3CString%3E mapTitleRow(Sheet sheet) %7B%0A%09%09List%3CString%3E names = super.mapTitleRow(sheet);%0A%09%09List%3CString%3E mappedNames = LangUtils.newArrayList();%0A%09%09for(String name : names)%7B%0A%09%09%09if(!nameMap.containsKey(name))%0A%09%09%09%09throw new BaseException(%22no mapped name found: %22 + name);%0A%09%09%09mappedNames.add(nameMap.get(name));%0A%09%09%7D%0A%09%09return mappedNames;%0A%09%7D%0A%09%0A%7D%0A

add MapedBeanRowMapper