{"id":19032754,"url":"https://github.com/joutvhu/fixed-width-parser","last_synced_at":"2025-08-25T10:05:38.320Z","repository":{"id":47507926,"uuid":"295805569","full_name":"joutvhu/fixed-width-parser","owner":"joutvhu","description":"Fixed Width Parser: parse fixed width string to object and export object to fixed width string","archived":false,"fork":false,"pushed_at":"2023-10-22T10:12:32.000Z","size":292,"stargazers_count":15,"open_issues_count":3,"forks_count":4,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-04-23T16:53:31.319Z","etag":null,"topics":["annotation","annotations","fixed-width-text","java","parser","string-parser"],"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/joutvhu.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null}},"created_at":"2020-09-15T17:45:23.000Z","updated_at":"2024-09-04T11:04:17.000Z","dependencies_parsed_at":"2022-09-09T20:20:15.738Z","dependency_job_id":"17f86dc3-8abd-4505-b10b-52f55e70e164","html_url":"https://github.com/joutvhu/fixed-width-parser","commit_stats":null,"previous_names":[],"tags_count":9,"template":false,"template_full_name":null,"purl":"pkg:github/joutvhu/fixed-width-parser","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/joutvhu%2Ffixed-width-parser","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/joutvhu%2Ffixed-width-parser/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/joutvhu%2Ffixed-width-parser/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/joutvhu%2Ffixed-width-parser/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/joutvhu","download_url":"https://codeload.github.com/joutvhu/fixed-width-parser/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/joutvhu%2Ffixed-width-parser/sbom","scorecard":{"id":534940,"data":{"date":"2025-08-11","repo":{"name":"github.com/joutvhu/fixed-width-parser","commit":"b950081728db4379c8fb02209645cb6b7fd0d115"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":4.8,"checks":[{"name":"Code-Review","score":2,"reason":"Found 3/13 approved changesets -- score normalized to 2","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":10,"reason":"no dangerous workflow patterns detected","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":"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":9,"reason":"detected GitHub workflow tokens with excessive permissions","details":["Info: jobLevel 'contents' permission set to 'read': .github/workflows/gradle-publish.yml:15","Warn: no topLevel permission defined: .github/workflows/gradle-publish.yml:1","Info: no jobLevel write permissions found"],"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":"Binary-Artifacts","score":9,"reason":"binaries present in source code","details":["Warn: binary detected: gradle/wrapper/gradle-wrapper.jar:1"],"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":"Pinned-Dependencies","score":0,"reason":"dependency not pinned by hash detected -- score normalized to 0","details":["Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/gradle-publish.yml:19: update your workflow using https://app.stepsecurity.io/secureworkflow/joutvhu/fixed-width-parser/gradle-publish.yml/main?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/gradle-publish.yml:22: update your workflow using https://app.stepsecurity.io/secureworkflow/joutvhu/fixed-width-parser/gradle-publish.yml/main?enable=pin","Warn: third-party GitHubAction not pinned by hash: .github/workflows/gradle-publish.yml:28: update your workflow using https://app.stepsecurity.io/secureworkflow/joutvhu/fixed-width-parser/gradle-publish.yml/main?enable=pin","Warn: third-party GitHubAction not pinned by hash: .github/workflows/gradle-publish.yml:36: update your workflow using https://app.stepsecurity.io/secureworkflow/joutvhu/fixed-width-parser/gradle-publish.yml/main?enable=pin","Warn: third-party GitHubAction not pinned by hash: .github/workflows/gradle-publish.yml:47: update your workflow using https://app.stepsecurity.io/secureworkflow/joutvhu/fixed-width-parser/gradle-publish.yml/main?enable=pin","Info:   0 out of   2 GitHub-owned GitHubAction dependencies pinned","Info:   0 out of   3 third-party GitHubAction dependencies pinned"],"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":"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":"Vulnerabilities","score":10,"reason":"0 existing vulnerabilities detected","details":null,"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}},{"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":"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":"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 25 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"}}]},"last_synced_at":"2025-08-20T06:41:43.553Z","repository_id":47507926,"created_at":"2025-08-20T06:41:43.553Z","updated_at":"2025-08-20T06:41:43.553Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":272044911,"owners_count":24864020,"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","status":"online","status_checked_at":"2025-08-25T02:00:12.092Z","response_time":1107,"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":["annotation","annotations","fixed-width-text","java","parser","string-parser"],"created_at":"2024-11-08T21:30:57.858Z","updated_at":"2025-08-25T10:05:38.254Z","avatar_url":"https://github.com/joutvhu.png","language":"Java","readme":"# Fixed Width Parser\n\nFixed Width Parser is a small library that purpose is:\n\n- Parse fixed width string to java object.\n\n- Export java object to fixed width string.\n\n## Installation\n\n- If you are using Gradle just add the following dependency to your `build.gradle`.\n\n```groovy\ncompile \"com.github.joutvhu:fixed-width-parser:1.1.5\"\n```\n\n- Or add the following dependency to your `pom.xml` if you are using Maven.\n\n```xml\n\u003cdependency\u003e\n    \u003cgroupId\u003ecom.github.joutvhu\u003c/groupId\u003e\n    \u003cartifactId\u003efixed-width-parser\u003c/artifactId\u003e\n    \u003cversion\u003e1.1.5\u003c/version\u003e\n\u003c/dependency\u003e\n```\n\n## How to use?\n\nThe Fixed Width Parser makes it easy to switch back and forth between the string and the java object.\nYou only need to use the annotations provided by Fixed Width Parser to annotate your model class to use the parser.\n\n### Annotate the model class\n\nHere are some annotations that the parser offers you.\n\n- `@FixedObject` is used to annotate an object that can be converted to a string, or it can be parsed from a string.\n\n- `@FixedField` is used to annotate fields in the object.\nThe parser will ignore any fields that are not annotated by this annotation.\n\n- `@FixedParam` will be used to annotate the generic params. Ex: `List\u003c@FixedParam(length = 5) String\u003e`.\n\nIn addition to the annotations to describe the fixed width fields,\nthe _fixed-width-parser_ provides the following constraint annotations to validate fixed width value.\n\n- `@FixedFormat` is used to check for formatting and help parse with certain types of fields like `date`, `number`, `boolean`.\n\n- `@FixedOption` is used to ensure that the fixed width string is one of the specified options.\n\n- `@FixedRegex` is used to check that the fixed width string must match a regular expression.\n\nSee the following example:\n\n```java\n@FixedObject(subTypes = {\n        @FixedObject.Type(value = Food.class, prop = \"id\", matchWith = \"^[0-5].+$\")\n}, defaultSubType = Medicine.class)\npublic class Product {\n    @FixedField(label = \"Product Id\", start = 0, length = 5)\n    private Long id;\n\n    @FixedField(label = \"Product Name\", start = 5, length = 20)\n    private String name;\n}\n\n@FixedObject\npublic class Food extends Product {\n    @FixedFormat(format = \"MM/dd/yyyy\")\n    @FixedField(label = \"Expiry Date\", start = 25, length = 10)\n    private LocalDate expiryDate;\n\n    @FixedOption(options = {\"rice  \", \"breads\", \"fruit \"})\n    @FixedField(label = \"Type\", start = 35, length = 6)\n    private String type;\n}\n\n@FixedObject\npublic class Medicine extends Product {\n    @FixedFormat(format = \"Y|N\")\n    @FixedField(label = \"Topical\", start = 25, length = 1)\n    private Boolean topical;\n\n    @FixedField(label = \"Ingredients\", start = 26, length = 60)\n    private List\u003c@FixedParam(length = 15) String\u003e ingredients;\n}\n```\n\n### Convert fixed width string\n\n- Parse fixed width string to java object.\n\n```java\nFood food = (Food) FixedParser\n        .parser()\n        .parse(Product.class, \"00001Dragon Fruit        09/30/2020fruit \");\n\nMedicine medicine = (Medicine) FixedParser\n        .parser()\n        .parse(Product.class, \"60002Golden Star Balm    YCamphor        Peppermint oil Menthol        Tea Tree Oil   \");\n```\n\n- Export java object to fixed width string.\n\n```java\nString value = FixedParser\n    .parser()\n    .export(food);\n```\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjoutvhu%2Ffixed-width-parser","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjoutvhu%2Ffixed-width-parser","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjoutvhu%2Ffixed-width-parser/lists"}