{"id":21378146,"url":"https://github.com/honhimw/jackson-dataformat-excel-hyperlink","last_synced_at":"2025-03-16T10:15:56.983Z","repository":{"id":227414204,"uuid":"614299775","full_name":"honhimW/jackson-dataformat-excel-hyperlink","owner":"honhimW","description":"Extension for Jackson JSON processor that adds support for (de)serializing POJOs as Hyperlink formatted","archived":false,"fork":false,"pushed_at":"2025-01-20T03:21:38.000Z","size":551,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-01-20T04:23:08.661Z","etag":null,"topics":["excel","hyperlink","jackson","jackson-dataformat","java","java-8","poi","xlsx"],"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/honhimW.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}},"created_at":"2023-03-15T10:03:58.000Z","updated_at":"2025-01-20T03:21:40.000Z","dependencies_parsed_at":"2024-03-13T08:30:01.215Z","dependency_job_id":"560bff6e-c94f-445e-a365-a9d788fc72b6","html_url":"https://github.com/honhimW/jackson-dataformat-excel-hyperlink","commit_stats":null,"previous_names":["honhimw/jackson-dataformat-excel-hyperlink"],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/honhimW%2Fjackson-dataformat-excel-hyperlink","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/honhimW%2Fjackson-dataformat-excel-hyperlink/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/honhimW%2Fjackson-dataformat-excel-hyperlink/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/honhimW%2Fjackson-dataformat-excel-hyperlink/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/honhimW","download_url":"https://codeload.github.com/honhimW/jackson-dataformat-excel-hyperlink/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243852505,"owners_count":20358272,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","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":["excel","hyperlink","jackson","jackson-dataformat","java","java-8","poi","xlsx"],"created_at":"2024-11-22T09:28:58.316Z","updated_at":"2025-03-16T10:15:56.884Z","avatar_url":"https://github.com/honhimW.png","language":"Java","readme":"# Jackson Format Excel-Hyperlink\n\nThe project is forked from [scndry/jackson-dataformat-spreadsheet](https://github.com/scndry/jackson-dataformat-spreadsheet), which can dump data objects as (.xlsx) format, with Hyperlink links between objects. Structured data types (Class) correspond to a (Sheet), and array and class array types are dumped in a Sheet named “List”. It also supports reading/writing.\n\n---\n\n### Maven\n```xml\n\u003cproject\u003e\n  \u003cdependency\u003e\n    \u003cgroupId\u003eio.github.honhimw\u003c/groupId\u003e\n    \u003cartifactId\u003ejackson-dataformat-excel-hyperlink\u003c/artifactId\u003e\n    \u003cversion\u003e1.0.0\u003c/version\u003e\n  \u003c/dependency\u003e\n\u003c/project\u003e\n```\n\n### Gradle\n```groovy\n// Groovy\ndependencies {\n    implementation 'io.github.honhimw:jackson-dataformat-excel-hyperlink:1.0.0'\n}\n```\n```kotlin\n// Kotlin\ndependencies {\n    implementation(\"io.github.honhimw:jackson-dataformat-excel-hyperlink:1.0.0\")\n}\n```\n\n---\n## Excel-Hyperlink format\n\nThe commonly used (.xlsx) format document for office suite spreadsheets, which consists of three basic parts: sheet, row, and cell.\n\n|                  | JSON       | JAVA                                | Excel-Hyperlink                                   |\n|------------------|------------|-------------------------------------|---------------------------------------------------|\n| object           | {}         | Type(.class)                        | sheet                                             |\n| property         | key        | property                            | sheet title row/column index                      |\n| array            | []         | array/Collection                    | sheet named \"List\" column index means array index |\n| string           | \"\"         | String                              | string type cell value                            |\n| numeric          | -1.1       | Number(int/short/long/float/double) | numeric type cell value                           |\n| boolean          | true/false | Boolean                             | boolean type cell value                           |\n| null             | null       | null                                | null/blank type cell value                        |\n| separator        | ,          | memory                              | cell                                              |\n| object reference | {}         | memory                              | Hyperlink                                         |\n| map              | native     | Map.class interface                 | not supported💀                                   |\n\n---\n### Person\n| id  | name  | address(Object) | properties |\n|-----|-------|-----------------|------------|\n| 1   | hello | #Address!2:2    | #List!1:1  |\n| 2   | world | #Address!3:3    | #List!2:2  |\n\n### Address\n| country | postal_code |\n|---------|-------------|\n| HELLO   | 0000000     |\n| WORLD   | 0000001     |\n\n\n### List\n| 0             | 1           | 2                           | 3                           | 4      | 5   |\n|---------------|-------------|-----------------------------|-----------------------------|--------|-----|\n| #Person!3:3   | hello       | 175.8                       | 121.3                       | master | |\n| world         | hah         | #List!3:3                   |                             |        | |\n| more and more | nested loop | Map types are not supported | column index is array index |        | |\n\n---\n\n## Feature\n\n### io.github.honhimw.jackson.dataformat.hyper.deser.BookParser.Feature\n\n| Features               | Default | Description                                    |\n|------------------------|---------|------------------------------------------------|\n| BLANK_ROW_AS_NULL      | true    | Blank row read as an null object in collection |\n| BREAK_ON_BLANK_ROW     | false   | Blank row as symbol for ending                 |\n| REORDER_BY_COLUMN_NAME | false   | Reorder schema by sheet title column           |\n\n### io.github.honhimw.jackson.dataformat.hyper.HyperGenerator.Feature\n\n| Features   | Default | Description                                                                                                            |\n|------------|---------|------------------------------------------------------------------------------------------------------------------------|\n| HYPERLINKE | true    | Using hyperlinks to describe object relationships\u003cbr/\u003e**Note.** Number of hyperlinks is usually limited to 65536.\u003cbr/\u003e |\n\n## Usage\n\n```java\npublic static void main(String[]args){\n    HyperMapper mapper = new HyperMapper();\n    mapper.disable(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES);\n    List\u003cPerson\u003e people = List.of(); /* collection of pojo */\n    File file = new File(\"some file\");\n    mapper.writeValue(file, people);\n\n    List\u003cperson\u003e readDatas = mapper.readValues(file, Person.class);\n    Asserts.status(Objects.equals(people, readDatas), \"supposed to be the same\");\n}\n```\n\n```java\nimport java.io.Serializable;\n\n@JsonClassDescription(\"name for excel sheet\")\n@ThisIsACustomAnnotation(\"name for excel sheet\") // supported by using TableNameResolver.class\npublic class Person implements Serializable {\n    \n    @JsonPropertyDescription(\"name for excel column\")\n    @ThisIsACustomAnnotation(\"name for excel column\") // supported by using ColumnNameResolver.class\n    private Long id;\n    \n    @JsonIgnore // jackson-annotations are supported\n    private String remark;\n}\n```\n\n### ReadVisitor/WriteVisitor\n```java\nHyperMapper mapper = new HyperMapper();\nmapper.acceptWriteVisitor(visitor -\u003e new BookWriteVisitor(visitor) {\n    @Override\n    public SheetWriteVisitor visitSheet(final Sheet sheet, final Table table) {\n        SheetWriteVisitor sheetWriteVisitor = super.visitSheet(sheet, table);\n        System.out.println(\"write sheet: \" + sheet.getSheetName());\n        SheetWriteVisitor sheetWriteVisitor1 = new SheetWriteVisitor(sheetWriteVisitor) {\n            @Override\n            public RowWriteVisitor visitRow(final Row row, final Object value) {\n                System.out.println(\"object: \" + value);\n                return super.visitRow(row, value);\n            }\n        };\n        return sheetWriteVisitor1;\n    }\n\n    @Override\n    public void visitEnd() {\n        System.out.println(\"write done\");\n    }\n});\nmapper.acceptReadVisitor(visitor -\u003e new BookReadVisitor(visitor) {\n    @Override\n    public SheetReadVisitor visitSheet(final Sheet sheet) {\n        SheetReadVisitor sheetReadVisitor = super.visitSheet(sheet);\n        System.out.println(\"read sheet: \" + sheet.getSheetName());\n\n        return new SheetReadVisitor(sheetReadVisitor) {\n            @Override\n            public RowReadVisitor visitRow(final Row row) {\n                System.out.println(\"read row: \" + row.getRowNum());\n                RowReadVisitor rowReadVisitor = super.visitRow(row);\n\n                return new RowReadVisitor(rowReadVisitor) {\n                    @Override\n                    public CellValue visitCell(final Cell cell, final Column column) {\n                        CellValue cellValue = super.visitCell(cell, column);\n                        System.out.println((Objects.isNull(column) ? cell.getColumnIndex() : column.getName()) + \": \" + cellValue);\n                        return cellValue;\n                    }\n                };\n            }\n        };\n    }\n});\n```\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhonhimw%2Fjackson-dataformat-excel-hyperlink","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fhonhimw%2Fjackson-dataformat-excel-hyperlink","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhonhimw%2Fjackson-dataformat-excel-hyperlink/lists"}