JAVA Table Mapper Annotation Driven
- Excel xlsx
- Excel 1997-2003
- Primitives types conversions
- Default value
- Column name with regular expression
- Date formatter for parsing date string value
Type | Read | Write | Update |
---|---|---|---|
CSV | No | Yes | NA |
Excel | Yes | No | Yes |
<dependency>
<groupId>com.github.btheu.table-mapper</groupId>
<artifactId>table-mapper</artifactId>
<version>0.3.0</version>
</dependency>
@SheetAll
@Sheet("Feuil1")
@Sheet({"Feuil1","Feuil2"})
@Column("Table Column Name")
InputStream document = ...
List<PojoTable> parseExcel = TableMapper.parseExcel(document, PojoTable.class);
// No @Sheet => Handle the first sheet only by default
public class PojoTable {
@Column(value = "Numéro de rue", type = CellType.INT)
private int numero;
@Column("La rue")
private String rue;
@Column("La ville")
private String ville;
@Column(value = "Date création", type = CellType.DATE)
private Date création;
@Column(value = "Cout", type = CellType.BIG_DECIMAL)
private BigDecimal cout;
}
- Handle csv file as input
- Handle Excel file as simple output
- Handle csv file as output