From 2c39acda8e846af8274a9f9354763f957228e34b Mon Sep 17 00:00:00 2001 From: heyunxia Date: Thu, 19 Nov 2015 11:05:41 +0800 Subject: [PATCH 1/6] =?UTF-8?q?=E6=B7=BB=E5=8A=A0Demo=E6=B5=8B=E8=AF=95?= =?UTF-8?q?=E5=AF=BC=E5=87=BA=E5=8A=9F=E8=83=BD=20TestExportOrder.java?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/test/java/DateValueConverter.java | 30 +++++++ src/test/java/EnumOrderStatus.java | 43 ++++++++++ src/test/java/EnumValueConverter.java | 18 ++++ src/test/java/PriceValueConverter.java | 36 ++++++++ src/test/java/TestExportOrder.java | 45 ++++++++++ src/test/java/WashOrder.java | 111 +++++++++++++++++++++++++ 6 files changed, 283 insertions(+) create mode 100644 src/test/java/DateValueConverter.java create mode 100644 src/test/java/EnumOrderStatus.java create mode 100644 src/test/java/EnumValueConverter.java create mode 100644 src/test/java/PriceValueConverter.java create mode 100644 src/test/java/TestExportOrder.java create mode 100755 src/test/java/WashOrder.java diff --git a/src/test/java/DateValueConverter.java b/src/test/java/DateValueConverter.java new file mode 100644 index 0000000..5dc1460 --- /dev/null +++ b/src/test/java/DateValueConverter.java @@ -0,0 +1,30 @@ +import com.ebay.xcelite.converters.ColumnValueConverter; + +import java.text.ParseException; +import java.text.SimpleDateFormat; +import java.util.Date; + +/** + * @author heyunxia (love3400wind@163.com) + * @version 1.0 + * @since 2015-10-21 下午12:31 + */ +public class DateValueConverter implements ColumnValueConverter { + SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); + @Override + public String serialize(Long value) { + Date date = new Date(); + date.setTime(value); + return sdf.format(date); + } + + @Override + public Long deserialize(String value) { + try { + return sdf.parse(value).getTime(); + } catch (ParseException e) { + e.printStackTrace(); + return 0l; + } + } +} diff --git a/src/test/java/EnumOrderStatus.java b/src/test/java/EnumOrderStatus.java new file mode 100644 index 0000000..1d6ddd2 --- /dev/null +++ b/src/test/java/EnumOrderStatus.java @@ -0,0 +1,43 @@ +/** + * @author heyunxia. + * @Description 订单状态 + * @time 2015/5/21 17:39 + */ +public enum EnumOrderStatus { + + PAYED(11, "已支付,待分配"), + CANCELBY_CUSTOMER(12, "用户取消"), + CANCELBY_STAFF(13, "调度人员取消"), + EXPIRED(14, "已过期"), + ASSIGNED(17, "已分配"), + FINISH_WASHING(19, "师傅洗车完成"), + UNKONWN(999, "未知状态"); + + private final int code; + private final String reason; + + EnumOrderStatus(int statusCode, String reasonPhrase) { + this.code = statusCode; + this.reason = reasonPhrase; + + } + + public static EnumOrderStatus fromStatusCode(int statusCode) { + for (EnumOrderStatus item : values()) { + if (item.code == statusCode) { + return item; + } + } + + return UNKONWN; + } + + public int getStatusCode() { + return this.code; + } + + public String toString() { + return this.reason; + } + +} diff --git a/src/test/java/EnumValueConverter.java b/src/test/java/EnumValueConverter.java new file mode 100644 index 0000000..ae3292e --- /dev/null +++ b/src/test/java/EnumValueConverter.java @@ -0,0 +1,18 @@ +import com.ebay.xcelite.converters.ColumnValueConverter; + +/** + * @author heyunxia + * @version 1.0 + * @since 2015-10-21 上午11:54 + */ +public class EnumValueConverter implements ColumnValueConverter { + @Override + public String deserialize(EnumOrderStatus value) { + return null; + } + + @Override + public EnumOrderStatus serialize(String value) { + return EnumOrderStatus.fromStatusCode(Integer.valueOf(value)); + } +} diff --git a/src/test/java/PriceValueConverter.java b/src/test/java/PriceValueConverter.java new file mode 100644 index 0000000..07ca3db --- /dev/null +++ b/src/test/java/PriceValueConverter.java @@ -0,0 +1,36 @@ +import com.ebay.xcelite.converters.ColumnValueConverter; + +import java.math.BigDecimal; + +/** + * @author heyunxia + * @version 1.0 + * @since 2015-10-21 下午12:02 + */ +public class PriceValueConverter implements ColumnValueConverter { + @Override + public Integer deserialize(String value) { + return null; + } + + @Override + public String serialize(Integer value) { + + return fmtPrice(value.longValue()); + } + + + public static Long fmtPrice(String price) { + + Float fPrice = Float.parseFloat(price) * 100; + return fPrice.longValue(); + } + // 分 转换 元(String) + public static String fmtPrice(Long price) { + BigDecimal a = new BigDecimal(price); + BigDecimal b = new BigDecimal(100); + BigDecimal c = a.divide(b, 2, BigDecimal.ROUND_HALF_UP); + + return c.toString(); + } +} diff --git a/src/test/java/TestExportOrder.java b/src/test/java/TestExportOrder.java new file mode 100644 index 0000000..d9e4bb2 --- /dev/null +++ b/src/test/java/TestExportOrder.java @@ -0,0 +1,45 @@ +import com.ebay.xcelite.Xcelite; +import com.ebay.xcelite.sheet.XceliteSheet; +import com.ebay.xcelite.writer.SheetWriter; +import com.google.common.collect.Lists; + +import java.io.File; +import java.util.List; + +/** + * @author heyunxia + * @version 1.0 + * @since 2015-10-21 上午11:39 + */ +public class TestExportOrder { + public static void main(String[] args) { + Xcelite xcelite = new Xcelite(); + XceliteSheet sheet = xcelite.createSheet("users"); + SheetWriter writer = sheet.getBeanWriter(WashOrder.class); + List users = Lists.newArrayList(); + WashOrder washOrder = new WashOrder("01", "姓名", 1111, "11", 1, 1444910884496l); + users.add(washOrder); + + washOrder = new WashOrder("02", "姓名1",111, "12", 2, 1444900884496l); + users.add(washOrder); + + washOrder = new WashOrder("03", "姓名2", 111, "14", 3, 1444911884496l); + users.add(washOrder); + + washOrder = new WashOrder("04", "姓名3", 1911, "13", 4, 1444930884496l); + users.add(washOrder); + + washOrder = new WashOrder("05", "姓名4", 1811, "17", 5, 1444940884496l); + users.add(washOrder); + + washOrder = new WashOrder("06", "姓名5", 1981, "19", 7, 1444910584496l); + users.add(washOrder); + + + writer.write(users); + xcelite.write(new File("users_doc.xlsx")); + + } +} + + diff --git a/src/test/java/WashOrder.java b/src/test/java/WashOrder.java new file mode 100755 index 0000000..f1219fd --- /dev/null +++ b/src/test/java/WashOrder.java @@ -0,0 +1,111 @@ +import com.ebay.xcelite.annotations.Column; +import com.ebay.xcelite.annotations.Row; + +import java.io.Serializable; + +/** + * @author heyunxia (love3400wind@163.com) + * @version 1.0 + * @since 2015-10-21 下午12:31 + */ + +@Row(colsOrder = {"编号", "姓名", "支付方式", "价格", "支付状态", "支付时间"}) +public class WashOrder implements Serializable { + + + private static final long serialVersionUID = 8794087388514650389L; + + /** + * 主键ID + */ + @Column(name = "编号") + private String id; + /** + * 会员姓名 + */ + @Column(name = "姓名") + private String name; + /** + * 原价 + */ + @Column(name = "价格", converter = PriceValueConverter.class) + private Integer sellPrice; + + /** + * 支付方式 + */ + @Column(name = "支付方式", converter = EnumValueConverter.class) + private String payType; + + /** + * 支付状态 + */ + @Column(name = "支付状态") + private Integer payStatus; + + /** + * 支付时间 + */ + @Column(name = "支付时间", converter = DateValueConverter.class) + private Long payAt; + + public String getId() { + return id; + } + + public void setId(String id) { + this.id = id; + } + + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + public Integer getSellPrice() { + return sellPrice; + } + + public void setSellPrice(Integer sellPrice) { + this.sellPrice = sellPrice; + } + + public String getPayType() { + return payType; + } + + public void setPayType(String payType) { + this.payType = payType; + } + + public Integer getPayStatus() { + return payStatus; + } + + public void setPayStatus(Integer payStatus) { + this.payStatus = payStatus; + } + + public Long getPayAt() { + return payAt; + } + + public void setPayAt(Long payAt) { + this.payAt = payAt; + } + + public WashOrder() { + } + + public WashOrder(String id, String name, Integer sellPrice, String payType, Integer payStatus, Long payAt) { + this.id = id; + this.name = name; + this.sellPrice = sellPrice; + this.payType = payType; + this.payStatus = payStatus; + this.payAt = payAt; + } +} From e0dd13ba432c1da55de4c0ecb969ddbc75f4637c Mon Sep 17 00:00:00 2001 From: heyunxia Date: Thu, 19 Nov 2015 11:11:10 +0800 Subject: [PATCH 2/6] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E6=97=A0=E6=B3=95?= =?UTF-8?q?=E5=A4=84=E7=90=86=E6=97=B6=E9=97=B4=E6=88=B5=E8=BD=AC=E6=8D=A2?= =?UTF-8?q?=E5=BC=82=E5=B8=B8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/test/java/WashOrder.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/test/java/WashOrder.java b/src/test/java/WashOrder.java index f1219fd..fc8506c 100755 --- a/src/test/java/WashOrder.java +++ b/src/test/java/WashOrder.java @@ -46,7 +46,7 @@ public class WashOrder implements Serializable { /** * 支付时间 */ - @Column(name = "支付时间", converter = DateValueConverter.class) + @Column(name = "支付时间", ignoreType = true, converter = DateValueConverter.class) private Long payAt; public String getId() { From 907cdea123a8f3c868e564c26b4cbe88f9c65401 Mon Sep 17 00:00:00 2001 From: heyunxia Date: Thu, 19 Nov 2015 11:11:52 +0800 Subject: [PATCH 3/6] =?UTF-8?q?=E6=89=A9=E5=B1=95=E8=BE=93=E5=85=A5?= =?UTF-8?q?=E5=88=B0OutputStream?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/main/java/com/ebay/xcelite/Xcelite.java | 29 ++++++++++++++++----- 1 file changed, 23 insertions(+), 6 deletions(-) diff --git a/src/main/java/com/ebay/xcelite/Xcelite.java b/src/main/java/com/ebay/xcelite/Xcelite.java index 90b7e9b..75c0637 100644 --- a/src/main/java/com/ebay/xcelite/Xcelite.java +++ b/src/main/java/com/ebay/xcelite/Xcelite.java @@ -15,12 +15,7 @@ */ package com.ebay.xcelite; -import java.io.ByteArrayOutputStream; -import java.io.File; -import java.io.FileInputStream; -import java.io.FileNotFoundException; -import java.io.FileOutputStream; -import java.io.IOException; +import java.io.*; import org.apache.poi.ss.usermodel.Sheet; import org.apache.poi.ss.usermodel.Workbook; @@ -138,6 +133,28 @@ public void write(File file) { } } } + + /** + * write data to the giving OutputStream + * + * @param out the OutputStream to write the data into + */ + public void write(OutputStream out) { + try { + workbook.write(out); + } catch (FileNotFoundException e) { + throw new RuntimeException(e); + } catch (IOException e) { + new RuntimeException(e); + } finally { + if (out != null) + try { + out.close(); + } catch (IOException e) { + new RuntimeException(e); + } + } + } /** * Gets the excel file as byte array. From 8f66dbcd5fefea8d1af3f272c83e1967756ea4ee Mon Sep 17 00:00:00 2001 From: heyunxia Date: Wed, 13 Jan 2016 13:40:10 +0800 Subject: [PATCH 4/6] handle exception Package should contain a content type part [M1.13] --- src/main/java/com/ebay/xcelite/Xcelite.java | 310 +++++++++++--------- 1 file changed, 176 insertions(+), 134 deletions(-) diff --git a/src/main/java/com/ebay/xcelite/Xcelite.java b/src/main/java/com/ebay/xcelite/Xcelite.java index 75c0637..f8fad2f 100644 --- a/src/main/java/com/ebay/xcelite/Xcelite.java +++ b/src/main/java/com/ebay/xcelite/Xcelite.java @@ -15,166 +15,208 @@ */ package com.ebay.xcelite; -import java.io.*; - +import com.ebay.xcelite.exceptions.XceliteException; +import com.ebay.xcelite.sheet.XceliteSheet; +import com.ebay.xcelite.sheet.XceliteSheetImpl; +import org.apache.poi.POIXMLDocument; +import org.apache.poi.hssf.usermodel.HSSFWorkbook; +import org.apache.poi.openxml4j.exceptions.InvalidFormatException; +import org.apache.poi.openxml4j.opc.OPCPackage; +import org.apache.poi.poifs.filesystem.POIFSFileSystem; import org.apache.poi.ss.usermodel.Sheet; import org.apache.poi.ss.usermodel.Workbook; import org.apache.poi.xssf.usermodel.XSSFWorkbook; -import com.ebay.xcelite.exceptions.XceliteException; -import com.ebay.xcelite.sheet.XceliteSheet; -import com.ebay.xcelite.sheet.XceliteSheetImpl; +import java.io.ByteArrayOutputStream; +import java.io.File; +import java.io.FileInputStream; +import java.io.FileNotFoundException; +import java.io.FileOutputStream; +import java.io.IOException; +import java.io.InputStream; +import java.io.OutputStream; +import java.io.PushbackInputStream; /** * Class description... - * + * * @author kharel (kharel@ebay.com) * @creation_date Nov 9, 2013 - * */ public class Xcelite { - private final Workbook workbook; - private File file; - - public Xcelite() { - workbook = new XSSFWorkbook(); - } - - public Xcelite(File file) { - try { - this.file = file; - workbook = new XSSFWorkbook(new FileInputStream(file)); - } catch (FileNotFoundException e) { - throw new RuntimeException(e); - } catch (IOException e) { - throw new RuntimeException(e); + private final Workbook workbook; + private File file; + + public Xcelite() { + workbook = new XSSFWorkbook(); } - } - - /** - * Creates new sheet. - * - * @return XceliteSheet object - */ - public XceliteSheet createSheet() { - return new XceliteSheetImpl(workbook.createSheet(), file); - } - - /** - * Creates new sheet with specified name. - * - * @param name the sheet name * - * @return XceliteSheet object - */ - public XceliteSheet createSheet(String name) { - return new XceliteSheetImpl(workbook.createSheet(name), file); - } - - /** - * Gets the sheet at the specified index. - * - * @param sheetIndex the sheet index - * @return XceliteSheet object - */ - public XceliteSheet getSheet(int sheetIndex) { - Sheet sheet = workbook.getSheetAt(sheetIndex); - if (sheet == null) { - throw new XceliteException(String.format("Could not find sheet at index %s", sheetIndex)); + + public Xcelite(File file) { + try { + this.file = file; + //workbook = new XSSFWorkbook(new FileInputStream(file)); + workbook = create(new FileInputStream(file)); + + + } catch (FileNotFoundException e) { + throw new RuntimeException(e); + } catch (IOException e) { + throw new RuntimeException(e); + } } - return new XceliteSheetImpl(sheet, file); - } - - /** - * Gets the sheet with the specified index. - * - * @param sheetIndex the sheet name - * @return XceliteSheet object - */ - public XceliteSheet getSheet(String sheetName) { - Sheet sheet = workbook.getSheet(sheetName); - if (sheet == null) { - throw new XceliteException(String.format("Could not find sheet named \"%s\"", sheetName)); + + /** + * handle exception : Package should contain a content type part [M1.13] + * @param in + * @return + */ + public static Workbook create(InputStream in) { + try { + if (!in.markSupported()) { + in = new PushbackInputStream(in, 8); + } + if (POIFSFileSystem.hasPOIFSHeader(in)) { + return new HSSFWorkbook(in); + } + if (POIXMLDocument.hasOOXMLHeader(in)) { + return new XSSFWorkbook(OPCPackage.open(in)); + } + } catch (InvalidFormatException e) { + e.printStackTrace(); + } catch (IOException e) { + e.printStackTrace(); + } + throw new IllegalArgumentException("你的excel版本目前poi解析不了"); } - return new XceliteSheetImpl(sheet, file); - } - - /** - * Saves data to the same file given in construction. If no such file - * specified an exception is thrown. - */ - public void write() { - if (file == null) { - throw new XceliteException("No file given in Xcelite object construction. Consider using method write(file)"); + + /** + * Creates new sheet. + * + * @return XceliteSheet object + */ + public XceliteSheet createSheet() { + return new XceliteSheetImpl(workbook.createSheet(), file); + } + + /** + * Creates new sheet with specified name. + * + * @param name the sheet name * + * @return XceliteSheet object + */ + public XceliteSheet createSheet(String name) { + return new XceliteSheetImpl(workbook.createSheet(name), file); + } + + public XceliteSheet createSheetFromTemplate(String name, String templateFile) { + return new XceliteSheetImpl(workbook.createSheet(name), new File(templateFile)); } - write(file); - } - - /** - * Saves data to a new file. - * - * @param file the file to save the data into - */ - public void write(File file) { - FileOutputStream out = null; - try { - out = new FileOutputStream(file, false); - workbook.write(out); - } catch (FileNotFoundException e) { - throw new RuntimeException(e); - } catch (IOException e) { - new RuntimeException(e); - } finally { - if (out != null) + + /** + * Gets the sheet at the specified index. + * + * @param sheetIndex the sheet index + * @return XceliteSheet object + */ + public XceliteSheet getSheet(int sheetIndex) { + Sheet sheet = workbook.getSheetAt(sheetIndex); + if (sheet == null) { + throw new XceliteException(String.format("Could not find sheet at index %s", sheetIndex)); + } + return new XceliteSheetImpl(sheet, file); + } + + /** + * Gets the sheet with the specified index. + * + * @param sheetIndex the sheet name + * @return XceliteSheet object + */ + public XceliteSheet getSheet(String sheetName) { + Sheet sheet = workbook.getSheet(sheetName); + if (sheet == null) { + throw new XceliteException(String.format("Could not find sheet named \"%s\"", sheetName)); + } + return new XceliteSheetImpl(sheet, file); + } + + /** + * Saves data to the same file given in construction. If no such file + * specified an exception is thrown. + */ + public void write() { + if (file == null) { + throw new XceliteException("No file given in Xcelite object construction. Consider using method write(file)"); + } + write(file); + } + + /** + * Saves data to a new file. + * + * @param file the file to save the data into + */ + public void write(File file) { + FileOutputStream out = null; try { - out.close(); + out = new FileOutputStream(file, false); + workbook.write(out); + } catch (FileNotFoundException e) { + throw new RuntimeException(e); } catch (IOException e) { - new RuntimeException(e); + new RuntimeException(e); + } finally { + if (out != null) + try { + out.close(); + } catch (IOException e) { + new RuntimeException(e); + } } } - } - - /** - * write data to the giving OutputStream - * - * @param out the OutputStream to write the data into - */ - public void write(OutputStream out) { - try { - workbook.write(out); - } catch (FileNotFoundException e) { - throw new RuntimeException(e); - } catch (IOException e) { - new RuntimeException(e); - } finally { - if (out != null) + + /** + * write data to the giving OutputStream + * + * @param out the OutputStream to write the data into + */ + public void write(OutputStream out) { try { - out.close(); + workbook.write(out); + } catch (FileNotFoundException e) { + throw new RuntimeException(e); } catch (IOException e) { - new RuntimeException(e); + new RuntimeException(e); + } finally { + if (out != null) + try { + out.close(); + } catch (IOException e) { + new RuntimeException(e); + } } } - } - - /** - * Gets the excel file as byte array. - * - * @return byte array which represents the excel file - */ - public byte[] getBytes() { - ByteArrayOutputStream baos = new ByteArrayOutputStream(); - try { - workbook.write(baos); - } catch (IOException e) { - new RuntimeException(e); - } finally { - if (baos != null) + + /** + * Gets the excel file as byte array. + * + * @return byte array which represents the excel file + */ + public byte[] getBytes() { + ByteArrayOutputStream baos = new ByteArrayOutputStream(); try { - baos.close(); + workbook.write(baos); } catch (IOException e) { - new RuntimeException(e); + new RuntimeException(e); + } finally { + if (baos != null) + try { + baos.close(); + } catch (IOException e) { + new RuntimeException(e); + } } + return baos.toByteArray(); } - return baos.toByteArray(); - } } From aaa64023618e3097c1a75569ed0c2a473349c81e Mon Sep 17 00:00:00 2001 From: He Yunxia Date: Sat, 20 Oct 2018 11:14:20 +0800 Subject: [PATCH 5/6] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E6=A8=A1=E6=9D=BF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- users_doc.xlsx | Bin 0 -> 4030 bytes 1 file changed, 0 insertions(+), 0 deletions(-) create mode 100644 users_doc.xlsx diff --git a/users_doc.xlsx b/users_doc.xlsx new file mode 100644 index 0000000000000000000000000000000000000000..d8062f5da211487d3a321ffc19c4f01e82bc8bfe GIT binary patch literal 4030 zcmaJ^2UJsO6D4#)uTl&}DFGzX1X-yfMM~%dfzSjA5Q?;*U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UTjfSsigQ~6mScc zvr?$MDLeDzl{31-?xt?2yg}gak(*XCWjmWTq7Pv~>xb`(e)}@$y~~)n3L^4Fql?jI ze&h&v9KVnr>y>M|tsSWcEH3d4Ak!1)I(5OUo=qVELz1zp@23$o0#D3Hq3g7_9DY$B zuC2;3Ey9>|akXWG#Zo~b-(w?T+XU8Fz&yOmri50dh$4lH-;BU!z8+(2N|p~XezjC* zywP|kLi+qeXdO=K(0si(?v|3d*C%^!++Dv~>5YNKD@4P)G_>nUhM_xzP7cCr39rvViK0 z8;5Jgu1QFCUxe}3>oAJ%yyuDmN)MTEMok0p&K;R(sPCa) zlEZ)GPnwuNr+5RR{_og8M@ynIv6W(P{h1y6L;3S2tKN6<{oWPk_#7RSB&P9cmv^r> zP-fZR7R{2AR+*1$D|At_yZCnL-tzRCUoe`iVY)n1G^(dcu0;Ir48=G{Thm&`oC z4&d_{i7;!Vv~*{ft98VI;Q6s#o!j%IbQ4R85td+<72b6@{`($)51_ui2OQOSRo~Ku zo2$7M#Rr}1sgsL>nu9CXXHI4C;kbI{3)}~=d-!Oxej~0R z3RfU%qm_rQ!h?;5{BI4m^3rEEkZ|PJ!fBo(q}VAa=LmIt?T8Hkq--R|OVUZ{Ph67z zZvR-B40Vs)iTlAxbxhn3j_nHJ&rWO$KRccjc0}=fY<7fx{1++xbAXdlim3mNZIVzB zKOX!qHTbjlNwGkbTgO&GP@4ZHzJ88yayAh~#j(*)evj}&V*KoSlAVde>)6Jrj$BW2 z@z2gDX^TkU$Hq=` Date: Sat, 20 Oct 2018 11:19:08 +0800 Subject: [PATCH 6/6] =?UTF-8?q?=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 0e775b7..9d271f5 100644 --- a/README.md +++ b/README.md @@ -131,7 +131,7 @@ private List mailAddresses; The CSVColumnValueConverter takes a collection of objects and serializes it to a comma seperated String. Alternately when deserializing, the converter takes a comma seperated String and deserializes it to a collection of Objects. So writing a collection of users will result with a cloumn named "Emails" and the column data will look someting like that: -john@mail.com,danny@mail.com,jerry@mail.com +john@mail.com,danny@mail.com,jerry@mail.com,love3400wind@163.com When reading the sheet to a collection of Users, the column "Emails" will be deserialized to an ArrayList. If you prefer a different collection implementation rather than the default ArrayList, you can always extend the CSVColumnValueConverter and override the getCollection() method to return your preferred implementation.