Monorepo containing small Spring/utility modules for common development tasks.
| English | δΈζ |
<dependency>
<groupId>org.springtools</groupId>
<artifactId>spring-excel-mapper</artifactId>
<version>1.0.0-SNAPSHOT</version>
</dependency>
// 1. Define model with annotations
@ExcelSheet
@ExcelRow(startRowIndex = 1)
public class StudentExcelModel {
@ExcelColumn(col = "A", required = true)
public String name;
@ExcelColumn(col = "B", regex = "^[\\w-\\.]+@([\\w-]+\\.)+[\\w-]{2,4}$")
public String email;
@ExcelColumn(col = "C", min = 18, max = 65)
public Integer age;
}
// 2. Parse Excel (with validation)
Workbook workbook = WorkbookFactory.create(inputStream);
ImportResult<StudentExcelModel> result =
ExcelMapper.parseWorkbookWithResult(workbook, StudentExcelModel.class, false);
// 3. Export to template (preserves styles)
Sheet sheet = workbook.getSheet("Students");
ExcelExporter.fillTableRows(sheet, 1, result.getSuccessList(), StudentExcelModel.class);
See Usage Patterns for detailed examples.
# Build all modules
mvn clean package
# Build specific module
mvn -pl spring-excel-mapper -am package
# Run example application
mvn -pl spring-tools-simples spring-boot:run