{"id":37030097,"url":"https://github.com/sondertara/tara","last_synced_at":"2026-01-14T03:39:08.435Z","repository":{"id":36395715,"uuid":"220164988","full_name":"sondertara/tara","owner":"sondertara","description":"Pure java project include excel kit and some utils","archived":false,"fork":false,"pushed_at":"2024-10-27T03:11:59.000Z","size":49970,"stargazers_count":8,"open_issues_count":2,"forks_count":3,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-07-10T11:25:11.229Z","etag":null,"topics":["async-export-excel","bean-copy","beanutils","excel","excel-export","excel-import","java","utils-lib"],"latest_commit_sha":null,"homepage":"","language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/sondertara.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2019-11-07T06:15:48.000Z","updated_at":"2022-11-20T10:33:50.000Z","dependencies_parsed_at":"2024-10-27T04:38:18.313Z","dependency_job_id":null,"html_url":"https://github.com/sondertara/tara","commit_stats":null,"previous_names":[],"tags_count":11,"template":false,"template_full_name":null,"purl":"pkg:github/sondertara/tara","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sondertara%2Ftara","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sondertara%2Ftara/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sondertara%2Ftara/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sondertara%2Ftara/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/sondertara","download_url":"https://codeload.github.com/sondertara/tara/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sondertara%2Ftara/sbom","scorecard":{"id":837734,"data":{"date":"2025-08-11","repo":{"name":"github.com/sondertara/tara","commit":"3ae3fcf9f27cb2c9e0dc8ece84850d07050cde15"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":2,"checks":[{"name":"Maintained","score":0,"reason":"0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#maintained"}},{"name":"Packaging","score":-1,"reason":"packaging workflow not detected","details":["Warn: no GitHub/GitLab publishing workflow detected."],"documentation":{"short":"Determines if the project is published as a package that others can easily download, install, easily update, and uninstall.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#packaging"}},{"name":"Token-Permissions","score":-1,"reason":"No tokens found","details":null,"documentation":{"short":"Determines if the project's workflows follow the principle of least privilege.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#token-permissions"}},{"name":"Dangerous-Workflow","score":-1,"reason":"no workflows found","details":null,"documentation":{"short":"Determines if the project's GitHub Action workflows avoid dangerous patterns.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#dangerous-workflow"}},{"name":"Code-Review","score":0,"reason":"Found 0/8 approved changesets -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project requires human code review before pull requests (aka merge requests) are merged.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#code-review"}},{"name":"CII-Best-Practices","score":0,"reason":"no effort to earn an OpenSSF best practices badge detected","details":null,"documentation":{"short":"Determines if the project has an OpenSSF (formerly CII) Best Practices Badge.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#cii-best-practices"}},{"name":"Security-Policy","score":0,"reason":"security policy file not detected","details":["Warn: no security policy file detected","Warn: no security file to analyze","Warn: no security file to analyze","Warn: no security file to analyze"],"documentation":{"short":"Determines if the project has published a security policy.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#security-policy"}},{"name":"Binary-Artifacts","score":10,"reason":"no binaries found in the repo","details":null,"documentation":{"short":"Determines if the project has generated executable (binary) artifacts in the source repository.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#binary-artifacts"}},{"name":"Pinned-Dependencies","score":-1,"reason":"no dependencies found","details":null,"documentation":{"short":"Determines if the project has declared and pinned the dependencies of its build process.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#pinned-dependencies"}},{"name":"License","score":10,"reason":"license file detected","details":["Info: project has a license file: LICENSE:0","Info: FSF or OSI recognized license: MIT License: LICENSE:0"],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#license"}},{"name":"Signed-Releases","score":-1,"reason":"no releases found","details":null,"documentation":{"short":"Determines if the project cryptographically signs release artifacts.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#signed-releases"}},{"name":"Fuzzing","score":0,"reason":"project is not fuzzed","details":["Warn: no fuzzer integrations found"],"documentation":{"short":"Determines if the project uses fuzzing.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#fuzzing"}},{"name":"Branch-Protection","score":-1,"reason":"internal error: error during branchesHandler.setup: internal error: githubv4.Query: Resource not accessible by integration","details":null,"documentation":{"short":"Determines if the default and release branches are protected with GitHub's branch protection settings.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#branch-protection"}},{"name":"SAST","score":0,"reason":"SAST tool is not run on all commits -- score normalized to 0","details":["Warn: 0 commits out of 27 are checked with a SAST tool"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}},{"name":"Vulnerabilities","score":0,"reason":"19 existing vulnerabilities detected","details":["Warn: Project is vulnerable to: GHSA-5mg8-w23w-74h3","Warn: Project is vulnerable to: GHSA-7g45-4rm6-3mm3","Warn: Project is vulnerable to: GHSA-78wr-2p64-hpwj","Warn: Project is vulnerable to: GHSA-j288-q9x7-2f5v","Warn: Project is vulnerable to: GHSA-8xfc-gm6g-vgpv","Warn: Project is vulnerable to: GHSA-hr8g-6v94-x4m9","Warn: Project is vulnerable to: GHSA-v435-xc8x-wvr9","Warn: Project is vulnerable to: GHSA-wjxj-5m7g-mg7q","Warn: Project is vulnerable to: GHSA-7m7h-rgvp-3v4r","Warn: Project is vulnerable to: GHSA-7mcw-xmx3-7p8m","Warn: Project is vulnerable to: GHSA-7p8c-crfr-q93p","Warn: Project is vulnerable to: GHSA-p2qf-9vp6-3jjq","Warn: Project is vulnerable to: GHSA-rr66-qh5m-w6mx","Warn: Project is vulnerable to: GHSA-rxgf-r843-g53h","Warn: Project is vulnerable to: GHSA-wxr5-93ph-8wr9","Warn: Project is vulnerable to: GHSA-4265-ccf5-phj5","Warn: Project is vulnerable to: GHSA-4g9r-vxhx-9pgx","Warn: Project is vulnerable to: GHSA-cgwf-w82q-5jrr","Warn: Project is vulnerable to: GHSA-gmg8-593g-7mv3"],"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}}]},"last_synced_at":"2025-08-23T19:36:02.037Z","repository_id":36395715,"created_at":"2025-08-23T19:36:02.037Z","updated_at":"2025-08-23T19:36:02.037Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28408850,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-14T01:52:23.358Z","status":"online","status_checked_at":"2026-01-14T02:00:06.678Z","response_time":107,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["async-export-excel","bean-copy","beanutils","excel","excel-export","excel-import","java","utils-lib"],"created_at":"2026-01-14T03:39:07.789Z","updated_at":"2026-01-14T03:39:08.421Z","avatar_url":"https://github.com/sondertara.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"# **Tara**\n\n[![Build Status](https://travis-ci.org/sondertara/tara.svg?branch=master)](https://travis-ci.org/sondertara/tara)\n![Java](https://img.shields.io/badge/Java-%5E1.8-brightgreen)\n![GitHub release (latest by date)](https://img.shields.io/github/v/release/sondertara/tara)\n![Maven Central](https://img.shields.io/maven-central/v/com.sondertara/tara)\n\n中文 | [English](README_en.md)\n\nTara是一个纯java工具包，包括常用util工具类和excel处理两个模块。\n\n\u003e **System Requirements:** Language: Java 8+\n\n## 💎**common-tara**\n\n通用工具包,包括常用的工具类,比如Bean 拷贝、时间处理、集合处理、IO操作、反射处理等常用工具\n\n### 🍵**Import to project**\n\n- Maven Project\n\n```xml\n\n\u003cdependency\u003e\n    \u003cgroupId\u003ecom.sondertara\u003c/groupId\u003e\n    \u003cartifactId\u003ecommon-tara\u003c/artifactId\u003e\n    \u003cversion\u003e1.0.3\u003c/version\u003e\n\u003c/dependency\u003e\n```\n\n- Gradle project\n\n```groovy\nimplementation 'com.sondertara:common-tara:1.0.3\n```\n\n### :eight_spoked_asterisk:**Features Induction**\n\n- [X] 轻量且高性能Bean Copier\n- [x] 常用集合处理工具，反射和时间处理工具等\n- [x] ID生成器\n- [X] 加密工具包\n- [X] 正则表达式工具\n\n#### :triangular_flag_on_post:***BeanUtils***\n\n`BeanUtils` 是一个轻量级且高性能的JavaBean复制框架，支持拷贝不同类型和嵌套属性的自动拷贝\n\n##### 1.属性类型一致对象拷贝\n\n属性类型对象间拷贝,性能和`Spring BeanUtils`相当(稍微快一点点~),循环多次拷贝，同其他框架对比的基准测试如下:\n\n![\"\"](example/result/same-benchmark.png)\n\n吞吐量测试结果:\n\n![\"\"](example/result/same-benchmark-thrpt.png)\n\n##### 2.属性类型不同嵌套对象拷贝\n\n属性类型不一致时,有些框架不支持该特性，但是`Tara BeanUtils`完全支持，并且有较好的性能表现。 基准测试如下:\n\n![\"\"](example/result/differ-benchmark.png)\n\n**Apache BeanUtils**: 运行异常\n\n**Spring BeanUtils**: 属性类型不同时值会丢失,当访问嵌套属性时,抛出`ClassCaseException`\n\n**Hutool**: 性能较弱\n\n**Dozer**: 性能稍好\n\n**Tara BeanUtils**: 和原生操作同一个量级\n\n所有基准测试源码存放于 [JMH Test](example/src/main/java/benchmark)，测试结果存放于 [JMH Result](example/result)\n\n## 💎**excel-tara**\n\n灵活且高性能Excel处理框架,支多种方式导入和导出Excel\n\n### 🍵Import to project\n\n- Maven Project\n\n```xml\n\n\u003cdependency\u003e\n    \u003cgroupId\u003ecom.sondertara\u003c/groupId\u003e\n    \u003cartifactId\u003eexcel-tara\u003c/artifactId\u003e\n    \u003cversion\u003e1.0.3\u003c/version\u003e\n\u003c/dependency\u003e\n```\n\n- Gradle project\n\n```groovy\n\n```\n\n### :eight_spoked_asterisk:**Features Induction**\n\n- [X] 导出支持注解导出、简易导出和读取模板导出\n- [x] 导出支持自动分Sheet,列宽自适应\n- [x] 注解导出支持自定义样式,间隙条纹,自定义宽高\n- [X] 导入支持注解导入和直接读取Excel中的数据\n- [X] 注解导入支持值转换和数据校验\n- [X] 直接导入支持流式读取\n\n所有使用样例存放于[Excel-Test example](example/src/main/java/com/sondertara/excel)\n\n#### :triangular_flag_on_post:**Excel Writer**\n\n`Tara Excel` 支持注解导出、快捷导出和模板导出三种方式\n\n##### **1.注解导出(ExcelBeanWriter)**\n\n注解导出支持直接传入导出对象List和实现导出对象分页查询接口两个方式\n\n- `@ExcelExport`: 对应Excel中的Sheet,支持导出多个不同数据的Sheet\n\n```java\n@Target(ElementType.TYPE)\n@Retention(RetentionPolicy.RUNTIME)\npublic @interface ExcelExport {\n\n    /**\n     * the multiple sheet order, smaller is parsed earlier\n     * 顺序（值越小，越靠前）\n     *\n     * @return order\n     */\n    int order() default 0;\n\n    /**\n     * The sheet name\n     * Sheet名称\n     *\n     * @return sheet name\n     */\n    String sheetName() default \"数据\";\n\n    /**\n     * the max row of one sheet,excluding the title row\n     * 每个Sheet页允许的最大条数（用于分页）\n     *\n     * @return the max row of one sheet\n     */\n    int maxRowsPerSheet() default 60000;\n\n    /**\n     * is open the row strip\n     * 是否开启条纹\n     *\n     * @return is open the row strip\n     */\n    boolean rowStriped() default true;\n\n    /**\n     * the row strip color\n     * 条纹颜色\n     *\n     * @return the color\n     */\n    String rowStripeColor() default \"E2EFDA\";\n\n    /**\n     * the title row height\n     * 标题行高度\n     *\n     * @return the title row height\n     */\n    int titleRowHeight() default 20;\n\n    /**\n     * the data row height\n     * 数据行高度\n     *\n     * @return the data row height\n     */\n    int dataRowHeight() default 20;\n\n    /**\n     * the bind type\n     * If {@link ExcelColBindType#COL_INDEX} the value {@link ExcelExportField#colIndex()} must be set.\n     * If {@link ExcelColBindType#ORDER} the colIndex is the order field definition order.\n     *\n     * @return whether enable colIndex\n     * @see ExcelColBindType\n     */\n    ExcelColBindType bindType() default ExcelColBindType.ORDER;\n\n    /**\n     * is open column auto width\n     * this is higher priority than {@link ExcelExportField#autoWidth()}\n     * 是否自动调整宽度\n     *\n     * @return is open all column auto width\n     */\n    boolean autoWidth() default false;\n    \n}\n```\n\n- `@ExcelExportField`: 对应Sheet中的列,支持每一列灵活定义\n\n```java\n@Target(ElementType.FIELD)\n@Retention(RetentionPolicy.RUNTIME)\npublic @interface ExcelExportField {\n    /**\n     * column name  alias\n     *\n     * @return column name\n     */\n    @AliasFor(\"colName\")\n    String value() default \"\";\n\n    /**\n     * 标题\n     * column name\n     *\n     * @return column name\n     */\n    @AliasFor(\"value\")\n    String colName() default \"\";\n\n    /**\n     * the colIndex ,begin is 1\n     * 列索引（从1开始）\n     *\n     * @return the colIndex\n     */\n    int colIndex() default -1;\n\n    /**\n     * default cell value\n     * 默认单元格值\n     */\n    String defaultCellValue() default \"\";\n\n    /**\n     * 列类型\n     * the cell type\n     *\n     * @return the CellType\n     * @see com.sondertara.excel.utils.ExcelFieldUtils#setCellValue(Cell, Object, Field, ExcelExportField, ExcelDefaultWriterResolver)\n     */\n    CellType cellType() default CellType.STRING;\n\n    /**\n     * custom data format\n     * 数据格式\n     * \u003cp\u003e\n     * eg: @ExcelDataFormat(\"yyyy/MM/dd\")\n     *\n     * @return the data format\n     */\n    ExcelDataFormat dataFormat() default @ExcelDataFormat;\n\n    /**\n     * data cell style\n     * 数据样式\n     *\n     * @return the style class {@link CellStyleBuilder} subclass\n     */\n    Class\u003c?\u003e dataCellStyleBuilder() default DefaultDataCellStyleBuilder.class;\n\n    /**\n     * the title cell style\n     * 标题样式\n     *\n     * @return the style class {@link CellStyleBuilder} subclass\n     */\n    Class\u003c?\u003e titleCellStyleBuilder() default DefaultTitleCellStyleBuilder.class;\n\n    /**\n     * is open auto width\n     * 是否自动调整宽度\n     *\n     * @return\n     */\n    boolean autoWidth() default false;\n\n    /**\n     * the custom column width,default is 16\n     * 自定义cell宽度\n     *\n     * @return the custom column width\n     */\n    int colWidth() default Constants.DEFAULT_COL_WIDTH;\n}\n```\n\n:balloon:**使用样例**\n\n为对象添加`ExportField`注解，导出列添加`ExcelExportField`注解，例如导出假期和用户数据到同一个Excel\n\n- 假期数据对应的JavaBean:\n  \n```java\n/**\n * The colindex of the export column is not effective because the bindType()  default is the order of properties definition,\n */\n@ExcelExport(sheetName = \"节假日\")\npublic class HolidayCfg {\n    /**\n     * ExcelDataFormat will display the value with the specified format.\n     */\n    @ExcelExportField(colName = \"节假日日期\", colIndex = 1, dataFormat = @ExcelDataFormat(\"yyyy-MM-dd HH:mm:ss\"))\n    private Date holidayDate;\n\n    @ExcelExportField(colName = \"节假日名称\", colIndex = 2)\n    private String holidayName;\n\n    /**\n     * ExcelKVConvert will convert the the property value to the map value when this property value equals the map key\n     */\n    @ExcelKVConvert(kvMap = {\"0=是\", \"1=否\"})\n    @ExcelExportField(colName = \"是否上班\", colIndex = 3)\n    private String isWork;\n\n    @ExcelExportField(colName = \"备注\", colIndex = 4)\n    private String remark;\n}\n```\n\n- 用户数据对应的JavaBean:\n\n```java\n\n@ExcelExport(sheetName = \"用户数据\")\npublic class User {\n    @ExcelExportField(colIndex = 2, colName = \"年龄\")\n    private Integer age;\n    \n    @ExcelExportField(colIndex = 1, colName = \"姓名\")\n    private String name;\n    \n    @ExcelExportField(colIndex = 3, colName = \"生日\", dataFormat = @ExcelDataFormat(\"yyyy-MM-dd\"))\n    private Date birth;\n    \n    @ExcelExportField(colIndex = 4, colName = \"体重\", dataFormat = @ExcelDataFormat(\"0.00\"))\n    private Double height;\n}\n```\n\n使用`ExcelBeanWriter`导出Excel文件\n\n```java\nimport java.util.ArrayList;\n\npublic class ExcelBeanWriteTest {\n    /**\n     * 通过查询的list导出\n     * Export by list directly\n     */\n    @Test\n    public void testWriteMultipleSheetByData() {\n        //Query data to list\n        List\u003cHolidayCfg\u003e holidayCfgList = new ArrayList\u003c\u003e();\n        List\u003cUser\u003e users = new ArrayList\u003c\u003e();\n        // Export to OutputStream\n        try (FileOutputStream fos = new FileOutputStream(new File(DEFAULT_TARGET_EXCEL_DIR + \"export_multiple_sheet_data.xlsx\"))) {\n            ExcelBeanWriter.fromData().addData(holidayCfgList).addData(users).then().to(fos);\n        } catch (IOException e) {\n            e.printStackTrace();\n        }\n        HttpServletResponse response = null;\n        // Export to HttpServletResponse\n        ExcelBeanWriter.fromData().addData(holidayCfgList).addData(users).then().to(response, \"Export_data\");\n    }\n\n    /**\n     * 通过分页查询导出\n     * Export by pagination query function which is based on  Producer-Consumer design pattern.\n     */\n    @Test\n    public void testSheetByQuery() {\n\n        // Export to OutputStream\n        try (FileOutputStream fos = new FileOutputStream(new File(DEFAULT_TARGET_EXCEL_DIR + \"export_multiple_sheet_data.xlsx\"))) {\n            ExcelBeanWriter.fromData().addData(index -\u003e {\n                // query data start index 0,page size is 1000,total number is 10000\n                Lis\u003cHolidayCfg\u003e holidayCfgList = new ArrayList\u003c\u003e();\n                return PageResult.of(holidayCfgList).pagination(index, 1000).total(10000L);\n            }).then().to(fos);\n        } catch (IOException e) {\n            e.printStackTrace();\n        }\n        HttpServletResponse response = null;\n        // Export to HttpServletResponse\n        ExcelBeanWriter.fromData().addData(holidayCfgList).addData(users).then().to(response, \"Export_data\");\n    }\n}\n```\n\n详情请参考 [ExcelBeanWriteTest](example/src/main/java/com/sondertara/excel/ExcelBeanWriteTest.java)\n\n##### **2.快捷导出(ExcelSimpleWriter)**\n\n快捷导出支持传入List对象和分页查询接口导出,样例\n\n```java\nExcelSimpleWriter.create().sheetName(\"Sheet\").header(titles).addData(List\u003cObject[]\u003e dataList).to();\nExcelSimpleWriter.create().sheetName(\"Sheet\").header(titles).addData(ExportFunction function).to();\n```\n\n详情请参考 [ExcelSimpleWriteTest](example/src/main/java/com/sondertara/excel/ExcelSimpleWriteTest.java)\n\n#### 🚩**Excel Reader**\n\n`Tara Excel` 支持注解读取和简单读取两种方式\n\n##### **1.注解读取(ExcelBeanReader)**\n\n- `@ExcelImport`: 对应Excel中的Sheet,可以读取指定Sheet页\n\n```java\n/**\n * @author huangxiaohu\n */\n@Target(ElementType.TYPE)\n@Retention(RetentionPolicy.RUNTIME)\npublic @interface ExcelImport {\n\n    /**\n     * bind the sheet index of Excel,begin is  1\n     * 绑定的sheet页（可多个, 从1开始）\n     *\n     * @return sheets\n     */\n    int[] sheetIndex() default {1};\n\n    /**\n     * point the data row num start,begin is 1\n     * 起始数据行(从1开始)\n     *\n     * @return the data row index\n     */\n    int firstDataRow() default 2;\n\n\n    /**\n     * 数据绑定类型\n     * data bind type,default order is the field definition order is class\n     * If {@link ExcelColBindType#COL_INDEX} the value {@link ExcelImportField#colIndex()} must be set.\n     * If {@link ExcelColBindType#ORDER} the colIndex is the order field definition order.\n     * If {@link ExcelColBindType#TITLE} the value {@link ExcelImportField#title()} must be set,and colIndex will calculate by the title in Excel\n     *\n     * @return the type of data bind\n     * @see ExcelColBindType\n     */\n    ExcelColBindType bindType() default ExcelColBindType.ORDER;\n\n}\n```\n\n- `@ExcelImportField`: 对应Sheet中的列，可绑定指定列和为空校验\n\n```java\n/**\n * @author huangxiaohu\n */\n@Target(ElementType.FIELD)\n@Retention(RetentionPolicy.RUNTIME)\npublic @interface ExcelImportField {\n\n    /**\n     * the col index,begin is 1\n     * it takes effect only when {@link ExcelImport#bindType()} is {@link com.sondertara.excel.enums.ExcelColBindType#COL_INDEX}\n     * 列索引(从1开始)\n     *\n     * @return the bind col index\n     */\n    int colIndex() default -1;\n\n    /**\n     * all empty cell\n     * 是否允许空值\n     *\n     * @return allow empty\n     */\n    boolean allowBlank() default true;\n\n    /**\n     * date format\n     * 日期格式\n     *\n     * @return the data format pattern\n     */\n    String dateFormat() default DatePattern.NORM_DATETIME_PATTERN;\n\n    /**\n     * the column title\n     * 列标题\n     * if {@link ExcelImport#bindType()} is {@link com.sondertara.excel.enums.ExcelColBindType#TITLE} this value must be set to the Excel title row cell\n     *\n     * @return the title\n     */\n    String title() default \"\";\n}\n```\n\n:balloon:**使用样例**\n\n为对象添加`ExcelImport`注解，导出列添加`ExcelImportField`注解，例如导入假期数据JavaBean:\n\n```java\nimport com.sondertara.excel.enums.ExcelColBindType;\n/**\n * bindType is title means auto-association column of sheet with title,the colIndex is not effective unless set bindType to {@link ExcelColBindType#COL_INDEX}\n */\n@Data\n@ExcelImport(sheetIndex = 1, firstDataRow = 2, bindType = ExcelColBindType.TITLE)\npublic class HolidayCfg {\n\n    @ExcelImportField(colIndex = 1, dateFormat = \"yyyy-MM-dd\", allowBlank = false, title = \"节假日日期\")\n    private Date holidayDate;\n\n    @ExcelImportField(colIndex = 2, allowBlank = false, title = \"节假日名称\")\n    private String holidayName;\n\n    @ExcelKVConvert(kvMap = {\"是=0\", \"否=1\"})\n    @ExcelImportField(colIndex = 3, allowBlank = false, title = \"是否上班\")\n    private String isWork;\n\n    @ExcelImportField(colIndex = 4, title = \"备注\")\n    private String remark;\n}\n```\n\n`ExcelBeanReader`读取数据:\n\n```java\npublic class ExcelReaderTest {\n\n    private static final String EXCEL_TEMPLATE_DIR = \"excel-template/\";// \"excel-template/\";\n\n    /**\n     * test the import annotation {@link com.sondertara.excel.meta.annotation.ExcelImport}\n     *\n     * @see ExcelKVConvert\n     */\n    @Test\n    public void testAnnotation() {\n        final InputStream is = Thread.currentThread().getContextClassLoader().getResourceAsStream(EXCEL_TEMPLATE_DIR + \"multi_sheet_data.xlsx\");\n\n        List\u003cHolidayCfg\u003e list = ExcelBeanReader.load(is).read(HolidayCfg.class);\n\n        Assertions.assertEquals(1000, list.size());\n        //test the ExcelKVConvert.\n        boolean isConvert = \"0\".equals(list.get(0).getIsWork()) || \"1\".equals(list.get(0).getIsWork());\n        Assertions.assertTrue(isConvert);\n    }\n}\n```\n\n##### **2.简单读取(ExcelSimpleReader)**\n\n实现xml解析器，支持流式读取Excel中的数据\n\n:balloon:**使用样例**\n\n```java\npublic class ExcelReaderTest {\n    /**\n     * Raw Excel parser, this is very faster\n     *\n     * @see ExcelSimpleReader\n     */\n    @Test\n    public void testRaw() {\n        final InputStream is = Thread.currentThread().getContextClassLoader().getResourceAsStream(EXCEL_TEMPLATE_DIR + \"duty_vacation.xlsx\");\n        try (ReadableWorkbook read = ExcelSimpleReader.load(is).read()) {\n            //can use stream api too\n            read.getSheets().forEach(sheet -\u003e {\n                try {\n                    List\u003cRow\u003e rows = sheet.read();\n\n                    for (int i = 1; i \u003c rows.size(); i++) {\n\n                        Row cells = rows.get(i);\n                        Cell cell = cells.getCell(2);\n                        if (i == 1) {\n                            Assertions.assertEquals(\"2019-10-10\", LocalDateTimeUtils.format(cell.asDate(), DatePattern.NORM_DATE_PATTERN));\n                        }\n                    }\n                    for (Row row : rows) {\n                        System.out.println(row);\n                    }\n                    Assertions.assertEquals(10, rows.size());\n                } catch (IOException e) {\n                    throw new RuntimeException(e);\n                }\n\n            });\n        } catch (IOException e) {\n            throw new RuntimeException(e);\n        }\n\n    }\n}\n```\n\n详情请参考 [ExcelReaderTest](example/src/main/java/com/sondertara/excel/ExcelReaderTest.java)\n\n## ☎️**联系方式**\n\nMy email :814494432@qq.com / xhhuangchn@outlook.com\n\n## 💓**鸣谢**\n\n### *JetBrains Support*\n\nWe graciously acknowledge the support of [JetBrains](https://www.jetbrains.com/community/opensource/#support?from=tara)\nwhich enables us to use the professional version\nof IntelliJ IDEA for developing this project.\n\n\u003ca href='https://www.jetbrains.com/community/opensource/#support?from=tara'\u003e\n   \u003cimg alt='' src='https://resources.jetbrains.com/storage/products/company/brand/logos/jb_beam.png' width=150 height=150 /\u003e\n\u003c/a\u003e\n\n### *Users*\n- [dhatim](https://github.com/dhatim?from=sondertara): Excel简单读取基于此项目开发 \u003ca href=\"https://github.com/dhatim/fastexcel?from=sondertara\"\u003efastexcel\u003c/a\u003e.\n\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsondertara%2Ftara","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsondertara%2Ftara","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsondertara%2Ftara/lists"}