{"id":19119535,"url":"https://github.com/kale-ko/ejcl","last_synced_at":"2026-02-02T21:45:12.154Z","repository":{"id":65783394,"uuid":"599419005","full_name":"Kale-Ko/EJCL","owner":"Kale-Ko","description":"An advanced configuration library for Java with support for local files, mysql databases, and more.","archived":false,"fork":false,"pushed_at":"2025-08-21T21:06:43.000Z","size":2246,"stargazers_count":2,"open_issues_count":1,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-08-21T22:56:12.244Z","etag":null,"topics":["config","configs","configuration","configuration-files","data","java","java-serialization","json","mariadb","mysql","parser","serialization","serializer","smile","yaml"],"latest_commit_sha":null,"homepage":"https://ejcl.kaleko.dev","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/Kale-Ko.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}},"created_at":"2023-02-09T04:58:11.000Z","updated_at":"2025-01-04T00:43:05.000Z","dependencies_parsed_at":"2023-12-23T12:06:38.373Z","dependency_job_id":"15f027d9-cf75-43e1-a8ed-9a25fd33df16","html_url":"https://github.com/Kale-Ko/EJCL","commit_stats":null,"previous_names":[],"tags_count":52,"template":false,"template_full_name":null,"purl":"pkg:github/Kale-Ko/EJCL","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Kale-Ko%2FEJCL","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Kale-Ko%2FEJCL/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Kale-Ko%2FEJCL/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Kale-Ko%2FEJCL/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Kale-Ko","download_url":"https://codeload.github.com/Kale-Ko/EJCL/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Kale-Ko%2FEJCL/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29021031,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-02T18:51:31.335Z","status":"ssl_error","status_checked_at":"2026-02-02T18:49:20.777Z","response_time":58,"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":["config","configs","configuration","configuration-files","data","java","java-serialization","json","mariadb","mysql","parser","serialization","serializer","smile","yaml"],"created_at":"2024-11-09T05:09:53.938Z","updated_at":"2026-02-02T21:45:12.125Z","avatar_url":"https://github.com/Kale-Ko.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"# EJCL\n\nEJCL is an advanced configuration library for Java with support for local files, MySQL databases, and more.\n\nEJCL is fully documented at [ejcl.kaleko.dev/docs](https://ejcl.kaleko.dev/docs/)\n\n## Config Types\n\nEJCL has two basic config types, [Structured](https://ejcl.kaleko.dev/docs/io/github/kale_ko/ejcl/StructuredConfig.html) and [Unstructured](https://ejcl.kaleko.dev/docs/io/github/kale_ko/ejcl/UnstructuredConfig.html).\n\n### Structured\n\nStructured configs are created with a Java class used as the \"structure\".\\\nCalling [`config#get()`](https://ejcl.kaleko.dev/docs/io/github/kale_ko/ejcl/StructuredConfig.html#get()) will return an instance of the type passed to the constructor for easy use of the object.\n\n### Unstructured\n\nUnstructured configs are not created with a defined \"structure\" and such can be used to store more dynamic data.\\\nTo get or set data on an unstructured config you can call [`config#get(path)`](https://ejcl.kaleko.dev/docs/io/github/kale_ko/ejcl/UnstructuredConfig.html#get(java.lang.String)) or [`config#set(path, value)`](https://ejcl.kaleko.dev/docs/io/github/kale_ko/ejcl/UnstructuredConfig.html#set(java.lang.String,java.lang.Object)) to do so (`path` can be any string and `value` can be any primitive).\n\n## Storage Types\n\nEJCL also offers a variety of storage options listed below.\n\n### Local Filesystem\n\nConfigs can be stored locally on the filesystem using classes from the [`io.github.kale_ko.ejcl.file`](https://ejcl.kaleko.dev/docs/io/github/kale_ko/ejcl/file/package-summary.html) package.\n\nThis includes a [`SimpleFileConfig`](https://ejcl.kaleko.dev/docs/io/github/kale_ko/ejcl/file/simple/package-summary.html) which is a config that stores key/value pairs in a very simple format, `{key}={type}={value}`.\n\nThere is also [`BJSLFileConfig`](https://ejcl.kaleko.dev/docs/io/github/kale_ko/ejcl/file/bjsl/package-summary.html) which is a config that stores data in a few common formats (JSON, YAML, and Json Smile).\\\nEach of these different formats can be used by passing their respective parsers ([`{format}Parser`](https://bjsl.kaleko.dev/docs/io/github/kale_ko/bjsl/parsers/package-summary.html)) to the constructor.\n\n### MySQL/MariaDB Server\n\nConfigs can also be stored on a MySQL or MariaDB server using classes from the [`io.github.kale_ko.ejcl.mysql`](https://ejcl.kaleko.dev/docs/io/github/kale_ko/ejcl/mysql/package-summary.html) package.\n\nThe structured version is slower to load but can be easier to work with, while the unstructured version has the advantage of only fetching the data you need.\n\nNote: The structured version only writes changed values to prevent overwriting others changes.\n\n### In Memory\n\nIf you want you can also use EJCL to store a config in memory but there is not much point to this unless you are using an API that only accepts Config objects.\n\n## Type Processors\n\nType processors are a way to convert between any Java type and object trees for storage. They can be created using `Builder#setProcessor(new ObjectProcessor.Builder().setX(y).build())`.\n\nSee [https://github.com/Kale-Ko/BJSL](https://github.com/Kale-Ko/BJSL?tab=readme-ov-file#type-processors) for information.\n\n## Annotations and Conditions\n\nAnnotations and conditions are just ways to tell the processor what to serialize and what not to.\n\nSee [https://github.com/Kale-Ko/BJSL](https://github.com/Kale-Ko/BJSL?tab=readme-ov-file#annotations-and-conditions) for information.\n\n## Full Example\n\n```java\nimport java.io.IOException;\nimport java.nio.file.Path;\n\nimport io.github.kale_ko.bjsl.parsers.JsonParser;\nimport io.github.kale_ko.bjsl.processor.ObjectProcessor;\nimport io.github.kale_ko.ejcl.file.bjsl.StructuredBJSLFileConfig;\n\npublic class Example {\n    public static class Data { // For more see https://github.com/Kale-Ko/BJSL?tab=readme-ov-file#full-example\n        private double foo;\n        private double bar = 17.8;\n\n        public double getFoo() {\n            return foo;\n        }\n\n        public double getBar() {\n            return bar;\n        }\n    }\n\n    public static void main(String[] args) throws IOException {\n        Path file = Path.of(\"config.json\");\n\n        JsonParser parser = new JsonParser.Builder().setPrettyPrint(true).build(); // Create a parser with default options\n        ObjectProcessor processor = new ObjectProcessor.Builder().build(); // Create a processor with default options\n\n        StructuredBJSLFileConfig\u003cData\u003e config = new StructuredBJSLFileConfig.Builder\u003c\u003e(Data.class, file, parser).setProcessor(processor).build(); // Create a StructuredBJSLFileConfig with our processor\n\n        config.load(); // Load the config from file\n\n        System.out.println(\"foo: \" + config.get().foo); // Read some values\n        System.out.println(\"bar: \" + config.get().bar);\n\n        config.get().foo += 5.0; // Modify a value\n\n        config.save(); // Save the config back to file\n\n        config.close(); // Finally close the config\n    }\n}\n```","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkale-ko%2Fejcl","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkale-ko%2Fejcl","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkale-ko%2Fejcl/lists"}