{"id":36425922,"url":"https://github.com/bingoohuang/excel2javabeans","last_synced_at":"2026-01-11T18:00:16.614Z","repository":{"id":12997189,"uuid":"73339711","full_name":"bingoohuang/excel2javabeans","owner":"bingoohuang","description":"convert excel rows to javabeans and vice visa","archived":false,"fork":false,"pushed_at":"2023-06-14T22:47:26.000Z","size":17098,"stargazers_count":19,"open_issues_count":2,"forks_count":6,"subscribers_count":4,"default_branch":"master","last_synced_at":"2025-07-19T12:48:44.483Z","etag":null,"topics":["beans","excel","java","poi"],"latest_commit_sha":null,"homepage":"","language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/bingoohuang.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}},"created_at":"2016-11-10T02:24:08.000Z","updated_at":"2024-03-27T07:15:10.000Z","dependencies_parsed_at":"2022-08-04T08:30:23.030Z","dependency_job_id":null,"html_url":"https://github.com/bingoohuang/excel2javabeans","commit_stats":null,"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"purl":"pkg:github/bingoohuang/excel2javabeans","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bingoohuang%2Fexcel2javabeans","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bingoohuang%2Fexcel2javabeans/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bingoohuang%2Fexcel2javabeans/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bingoohuang%2Fexcel2javabeans/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/bingoohuang","download_url":"https://codeload.github.com/bingoohuang/excel2javabeans/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bingoohuang%2Fexcel2javabeans/sbom","scorecard":{"id":238700,"data":{"date":"2025-08-11","repo":{"name":"github.com/bingoohuang/excel2javabeans","commit":"bb25c84a25c07aa83c9b2cb2457a0f8c0f4e3a0e"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":2.1,"checks":[{"name":"Code-Review","score":0,"reason":"Found 0/28 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":"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":"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":"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":"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":"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":"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":"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":"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":"License","score":10,"reason":"license file detected","details":["Info: project has a license file: LICENSE:0","Info: FSF or OSI recognized license: Apache License 2.0: 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":"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 2 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":1,"reason":"9 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-4g9r-vxhx-9pgx","Warn: Project is vulnerable to: GHSA-7hfm-57qf-j43q","Warn: Project is vulnerable to: GHSA-crv7-7245-f45f","Warn: Project is vulnerable to: GHSA-mc84-pj99-q6hh","Warn: Project is vulnerable to: GHSA-xqfj-vm6h-2x34","Warn: Project is vulnerable to: GHSA-j288-q9x7-2f5v","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-17T06:13:58.777Z","repository_id":12997189,"created_at":"2025-08-17T06:13:58.777Z","updated_at":"2025-08-17T06:13:58.777Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28316879,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-11T14:58:17.114Z","status":"ssl_error","status_checked_at":"2026-01-11T14:55:53.580Z","response_time":60,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"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":["beans","excel","java","poi"],"created_at":"2026-01-11T18:00:15.432Z","updated_at":"2026-01-11T18:00:16.583Z","avatar_url":"https://github.com/bingoohuang.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"# excel2javabeans\nconvert excel rows to javabeans and vice versa.\n\u003cbr/\u003e\n[![Build Status](https://travis-ci.org/bingoohuang/excel2javabeans.svg?branch=master)](https://travis-ci.org/bingoohuang/excel2javabeans)\n[![Quality Gate](https://sonarcloud.io/api/project_badges/measure?project=com.github.bingoohuang%3Aexcel2javabeans\u0026metric=alert_status)](https://sonarcloud.io/dashboard/index/com.github.bingoohuang%3Aexcel2javabeans)\n[![Coverage Status](https://coveralls.io/repos/github/bingoohuang/excel2javabeans/badge.svg?branch=master)](https://coveralls.io/github/bingoohuang/excel2javabeans?branch=master)\n[![Maven Central](https://maven-badges.herokuapp.com/maven-central/com.github.bingoohuang/excel2javabeans/badge.svg?style=flat-square)](https://maven-badges.herokuapp.com/maven-central/com.github.bingoohuang/excel2javabeans/)\n[![License](http://img.shields.io/:license-apache-brightgreen.svg)](http://www.apache.org/licenses/LICENSE-2.0.html)\n\n\n## Convert Excel to Javabeans\n![image](https://user-images.githubusercontent.com/1940588/33408746-0213ccf6-d5b3-11e7-9f89-1c6cf08322bf.png)\n\n```java\n// ... \nWorkbook workbook = getClassPathWorkbook(\"member.xlsx\");\nExcelToBeans excelToBeans = new ExcelToBeans(workbook);\nList\u003cBeanWithTitle\u003e beans = excelToBeans.convert(BeanWithTitle.class);\n// ...\n```\n\n```java\npublic class BeanWithTitle extends ExcelRowRef implements ExcelRowIgnorable {\n    @ExcelColTitle(\"会员姓名\") String memberName;\n    @ExcelColTitle(\"卡名称\") String cardName;\n    @ExcelColTitle(\"办卡价格\") String cardPrice;\n    @ExcelColTitle(\"性别\") String sex;\n\n    @Override public boolean ignoreRow() {\n        return StringUtils.startsWith(memberName, \"示例-\");\n    }\n    \n    // getters and setters ignored\n}\n```\n\n## Convert Javabeans to Excel\n```java\n@Data @Builder\npublic class ExportFollowUserExcelRow {\n    @ExcelColTitle(\"序号\") private int seq;\n    @ExcelColTitle(\"客户姓名\") private String name;\n    @ExcelColTitle(\"客户类型\") private String grade;\n    @ExcelColTitle(\"性别\") private String gender;\n    @ExcelColTitle(\"手机号码\") private String mobile;\n    @ExcelColTitle(\"建档时间\") private String createTime;\n    @ExcelColTitle(\"来源渠道\") private String sources;\n    @ExcelColTitle(\"跟进总数\") private String followTotalNum;\n    @ExcelColTitle(\"当前所属会籍\") private String advisorName;\n    @ExcelColTitle(\"最近跟进人\") private String currentFollowName;\n    @ExcelColTitle(\"最近跟进时间\") private String currentFollowTime;\n}\n\nWorkbook templateWorkbook = ExcelToBeansUtils.getClassPathWorkbook(\"assignment.xlsx\");\nBeansToExcel beansToExcel = new BeansToExcel(templateWorkbook);\nList\u003cExportFollowUserExcelRow\u003e members = Lists.newArrayList();\nmembers.add(...);\nmembers.add(...);\nmembers.add(...);\nmembers.add(...);\n\nWorkbook workbook = beansToExcel.create(members);\nExcelToBeansUtils.writeExcel(workbook, name);\n```\n\n![image](https://user-images.githubusercontent.com/1940588/33408898-d26086ce-d5b3-11e7-9431-c48ccf6799aa.png)\n\n# Cell Image Support\n\nNow the image in excel can be bound to bean field of type ImageData.\nThe image's axis will be computed to match the related cell. \n![image](https://user-images.githubusercontent.com/1940588/33585908-ab2809aa-d9a1-11e7-962e-ce7c142faf99.png)\n\n\n```java\n@Data\npublic class ImageBean {\n    @ExcelColTitle(\"图片\")\n    private ImageData imageData;\n    @ExcelColTitle(\"名字\")\n    private String name;\n}\n\npublic void testImage() {\n    Workbook val workbook = ExcelToBeansUtils.getClassPathWorkbook(\"images.xls\");\n    ExcelToBeans excelToBeans = new ExcelToBeans(workbook);\n    List\u003cImageBean\u003e beans = excelToBeans.convert(ImageBean.class);\n}\n```\n\n# List\u003cString/Integer\u003e bean fields support\n\n![image](https://user-images.githubusercontent.com/1940588/33585728-afbdced8-d9a0-11e7-8903-e172fafbf577.png)\n\n```java\n@Data\npublic static class MultipleColumnsBeanWithTitle {\n    @ExcelColTitle(\"会员姓名\") String memberName; // for the first row, the value will be \"张小凡\"\n    @ExcelColTitle(\"手机号\") List\u003cString\u003e mobiles; // for the first row，the values will be: null, \"18795952311\", \"18795952311\", \"18795952311\"\n    @ExcelColTitle(\"归属地\") List\u003cString\u003e homeareas; // for the first row, the values will be: \"南京\", \"北京\", \"上海\", \"广东\"\n}\n```\n\n# Excel SpringMVC upload and download demo\n```java\n\n/**\n * 从EXCEL中批量导入会员。\n */\n@RequestMapping(\"/ImportMembers\") @RestController\npublic class ImportMembersController {\n    /**\n     * 下载失败条目的EXCEL。\n     *\n     * @return RestResp\n     */\n    @RequestMapping(\"/downloadError\") @SneakyThrows\n    public RestResp downloadError(HttpServletResponse response) {\n        byte[] workbook = ImportMembersHelper.redisExcel4ImportMemberError();\n        if (workbook == null) {\n            return RestResp.ok(\"当前没有失败条目\");\n        }\n\n        ExcelDownloads.download(response, workbook, \"导入错误\" + WestId.next() + \".xlsx\");\n        return RestResp.ok(\"失败条目下载成功\");\n    }\n\n    /**\n     * 使用EXCEL 批量导入学员。\n     *\n     * @param file EXCEL文件\n     * @return RestResp\n     */\n    @RequestMapping(\"/importMembers\") @SneakyThrows\n    public RestResp importMembers(@RequestParam(\"file\") MultipartFile file) {\n        @Cleanup val excelToBeans = new ExcelToBeans(file.getInputStream());\n        val importedMembers = excelToBeans.convert(ImportedMember.class);\n        // ...\n    }\n\n}\n```\n\n# BeansToExcelOnTemplate\n![image](https://user-images.githubusercontent.com/1940588/48628405-003aa180-e9f2-11e8-83d7-429df9157a38.png)\n\n\n```java\n@Data @Builder\npublic class CepingResult {\n    @ExcelCell(sheetName = true)\n    private String sheetName;       // 表单名称\n\n    @ExcelCell(value = \"A2\", replace = \"XX\")\n    private String interviewCode;   // 面试编号\n\n    @ExcelCell\n    private String name;           // 身份证姓名\n    @ExcelCell\n    private String gender;         // 性别\n    @ExcelCell\n    private String age;            // 年龄\n\n    @ExcelCell(\"B4\")\n    private String position;       // 应聘职位\n    @ExcelCell(\"E4\")\n    private String level;          // 推荐职级\n    @ExcelCell(\"G4\")\n    private String annualSalary;   // 期望年薪\n\n    @ExcelCell(\"C5\")\n    private double matchScore;     // 岗位匹配度\n    @ExcelCell(value = \"C6\", maxLineLen = 40)\n    private String matchComment;   // 岗位匹配度评语\n}\n\n@Cleanup val wb = ExcelToBeansUtils.getClassPathWorkbook(\"template.xlsx\");\nval beansToExcel = new BeansToExcelOnTemplate(wb.getSheet(\"templateName\"));\n\n@Cleanup val newWb = beansToExcel.create(bean);\nPoiUtil.protectWorkbook(newWb, \"123456\");\nPoiUtil.writeExcel(newWb, \"exported.xlsx\");\n```\n\n# Sonarqube\n```bash\ntravis encrypt a7fe683637d6e1f54e194817cc36e78936d4fe61\n\nmvn clean install sonar:sonar -Dsonar.organization=bingoohuang-github -Dsonar.host.url=https://sonarqube.com -Dsonar.login=a7fe683637d6e1f54e194817cc36e78936d4fe61\n```\n\n# Problems\n## Autosize column does not work on CentOS.\nMaybe there is not relative fonts installed. Methods: \n1. Create fonts folder:`mkdir ~/.fonts` \n2. Copy fonts to the fold:`scp /System/Library/Fonts/STHeiti\\ Light.ttc yogaapp@test.ino01:./.fonts/`\n3. Install the fonts:`fc-cache -f -v`\n4. 查看字体: `fc-list|grep SimSun`\n\n```bash\n[betaoper@beta-hetong ~]$ fc-list|grep SimSun\n/usr/share/fonts/winfonts/simsun.ttc: 宋体,SimSun:style=常规,Regular\n/usr/share/fonts/winfonts/simsun.ttc: 新宋体,NSimSun:style=常规,Regular\n/usr/share/fonts/winfonts/simsunb.ttf: SimSun\\-ExtB:style=Regular,obyčejné\n```\n\n\n\nFor all users available, just copy the fonts file to the `/usr/share/fonts` directory and then `fc-cache -f -v`.\n\n## Emoji output error\nWhen writting emoji like 🦄女侠🌈💄💓 , the output excel content will show like ?女侠???, try to fix this with following dependency.\n```xml\n\u003cdependency\u003e\n    \u003cgroupId\u003eorg.apache.xmlbeans\u003c/groupId\u003e\n    \u003cartifactId\u003exmlbeans\u003c/artifactId\u003e\n    \u003cversion\u003e3.0.0\u003c/version\u003e\n\u003c/dependency\u003e\n```\n\n## How to manually test excel downloads in Chrome console?\n```javascript\n// execute the following javascript code in the console to download excel for testing\nvar fileName = \"abc.xlsx\"\nvar url = 'http://localhost:8090/yoga-system/MemberExportController/memberExport'\nvar request = new XMLHttpRequest()\nrequest.open('POST', url, true)\nrequest.setRequestHeader('Content-Type', 'application/json; charset=utf-8')\nrequest.responseType = 'blob'\nrequest.onload = function(e) {\n    if (this.status === 200) {\n        var blob = this.response;\n        if(window.navigator.msSaveOrOpenBlob) {\n            window.navigator.msSaveBlob(blob, fileName)\n        } else {\n            var downloadLink = window.document.createElement('a')\n            var contentTypeHeader = request.getResponseHeader(\"Content-Type\")\n            downloadLink.href = window.URL.createObjectURL(new Blob([blob], {type: contentTypeHeader}))\n            downloadLink.download = fileName\n            document.body.appendChild(downloadLink)\n            downloadLink.click()\n            document.body.removeChild(downloadLink)\n       }\n   }\n}\nrequest.send(JSON.stringify({firstBlood:false,export:true}));\n```\n## Ajax js\n```javascript\nexport const downloadBlobFile = (response) =\u003e {\n  const blob = new Blob([response.data], {type: response.data.type})\n  const contentDisposition = response.headers['content-disposition']\n  let fileName = 'unknown'\n  if (contentDisposition) {\n    const fileNameMatch = contentDisposition.match(/filename=\"(.+)\"/)\n    if (fileNameMatch.length === 2) {\n      fileName = decodeURIComponent(fileNameMatch[1])\n    }\n  }\n\n  if (window.navigator.msSaveOrOpenBlob) {\n    navigator.msSaveBlob(blob, fileName)\n  } else {\n    const link = document.createElement('a')\n    link.href = window.URL.createObjectURL(blob)\n    link.download = fileName\n    link.click()\n    window.URL.revokeObjectURL(link.href)\n  }\n}\n\nimport {downloadBlobFile} from 'utils'\nthis.$http.post('/BasicParametersController/exportPositions/', {}, {\n  responseType: 'blob'\n}).then((response) =\u003e {\n  downloadBlobFile(response)\n})\n\n```\n\n# gpg\n```bash\nGPG_TTY=$(tty)\nexport GPG_TTY\n```\n\n```fish\nset -gx GPG_TTY (tty)\n```\n\n```bash\nmvn clean install -DskipTests -Dgpg.passphrase=slgsdmxl\nmvn clean install -Dgpg.skip -DskipTests\n```\n\n# TODO\n1. Support SXSSF (Streaming Usermodel API) for very large spreadsheets have to be produced.\n\n# Warning\n\n1. Avoid to upgrade  poi-ooxml to 4.0.0. that will cause shift rows go failing. See [Bug 62711 New: Calling shiftRows corrupts file in POI 4.0](http://apache-poi.1045710.n5.nabble.com/Bug-62711-New-Calling-shiftRows-corrupts-file-in-POI-4-0-td5731583.html)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbingoohuang%2Fexcel2javabeans","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbingoohuang%2Fexcel2javabeans","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbingoohuang%2Fexcel2javabeans/lists"}