{"id":36698563,"url":"https://github.com/voomdoon/vd-from-string-parser","last_synced_at":"2026-01-12T11:36:06.451Z","repository":{"id":228723736,"uuid":"774750471","full_name":"voomdoon/vd-from-string-parser","owner":"voomdoon","description":null,"archived":false,"fork":false,"pushed_at":"2025-12-19T21:26:57.000Z","size":38,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-12-22T09:38:09.593Z","etag":null,"topics":["parsing"],"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/voomdoon.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,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2024-03-20T05:37:46.000Z","updated_at":"2025-12-19T21:26:55.000Z","dependencies_parsed_at":"2025-03-19T12:45:22.820Z","dependency_job_id":null,"html_url":"https://github.com/voomdoon/vd-from-string-parser","commit_stats":null,"previous_names":["voomdoon/vd-from-string-parser"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/voomdoon/vd-from-string-parser","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/voomdoon%2Fvd-from-string-parser","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/voomdoon%2Fvd-from-string-parser/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/voomdoon%2Fvd-from-string-parser/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/voomdoon%2Fvd-from-string-parser/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/voomdoon","download_url":"https://codeload.github.com/voomdoon/vd-from-string-parser/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/voomdoon%2Fvd-from-string-parser/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28338971,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-12T10:58:46.209Z","status":"ssl_error","status_checked_at":"2026-01-12T10:58:42.742Z","response_time":98,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: 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":["parsing"],"created_at":"2026-01-12T11:36:04.078Z","updated_at":"2026-01-12T11:36:06.428Z","avatar_url":"https://github.com/voomdoon.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"# vd-from-string-parser\n\n**Modular utility to parse Java objects from `String` values.**\n\nThis library supports a variety of common types and can be extended with custom parsers using Java’s Service Provider Interface (SPI).\n\nThis utility is used at [vd-from-properties-parser](https://github.com/voomdoon/vd-from-properties-parser) to support parsing objects from `Properties`.\n\n\n## Features\n\n- Built-in support for:\n  - Primitive types and their wrappers (`int`, `long`, `double`, `boolean`, etc.)\n  - `BigInteger`, `BigDecimal`\n  - `Pattern`, `Class`, `URL`, `URI`\n  - Enums\n- Extensible via SPI (Service Provider Interface via `META-INF/services`)\n- Simple, consistent API\n- Validates and initializes custom parsers at runtime\n\n---\n\n## Usage\n\n```java\nFromStringParsers parsers = FromStringParsers.DEFAULT;\n\nint number = parsers.parse(\"42\", int.class);\nURL url = parsers.parse(\"https://example.com\", URL.class);\nPattern pattern = parsers.parse(\"\\\\d+\", Pattern.class);\nMyEnum value = parsers.parse(\"VALUE\", MyEnum.class);\n```\n\n## Adding Custom Parsers\n\nTo support custom types, implement the `FromStringParser\u003cT\u003e` interface:\n\n```java\npublic class MyTypeParser implements FromStringParser\u003cMyType\u003e {\n\n    @Override\n    public Class\u003cMyType\u003e getResultClass() {\n        return MyType.class;\n    }\n\n    @Override\n    public MyType parse(String string) throws ParseException {\n        // convert string to MyType\n    }\n}\n```\n\nRegister the parser using Java’s SPI mechanism:\n\n1. Create a file named  \n   `META-INF/services/de.voomdoon.parser.fromstring.FromStringParser`\n\n2. List your implementation class inside that file:\n\n   ```\n   com.example.MyTypeParser\n   ```\n\nCustom parsers are discovered and loaded automatically.\n\n---\n\n## Error Handling\n\n- If no parser is registered for a given type, `parse` throws `UnsupportedOperationException`.\n- If a parser fails to declare its result class, an `InvalidParserException` is thrown during initialization.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvoomdoon%2Fvd-from-string-parser","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fvoomdoon%2Fvd-from-string-parser","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvoomdoon%2Fvd-from-string-parser/lists"}