{"id":21546768,"url":"https://github.com/cubeengine/reflect","last_synced_at":"2025-04-10T05:51:44.205Z","repository":{"id":50041710,"uuid":"13702023","full_name":"CubeEngine/ReflecT","owner":"CubeEngine","description":"Typesafe serialization of data for Java","archived":false,"fork":false,"pushed_at":"2025-03-21T00:05:56.000Z","size":773,"stargazers_count":14,"open_issues_count":9,"forks_count":2,"subscribers_count":8,"default_branch":"master","last_synced_at":"2025-03-21T01:21:54.056Z","etag":null,"topics":["config","cubeengine","java","library"],"latest_commit_sha":null,"homepage":"http://cubeisland.de","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/CubeEngine.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.txt","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}},"created_at":"2013-10-19T14:06:04.000Z","updated_at":"2025-03-21T00:06:01.000Z","dependencies_parsed_at":"2025-02-27T01:18:27.940Z","dependency_job_id":"1ff72b5c-5494-4644-a807-19a06ebedf8a","html_url":"https://github.com/CubeEngine/ReflecT","commit_stats":null,"previous_names":["cubeenginedev/configurationapi"],"tags_count":16,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CubeEngine%2FReflecT","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CubeEngine%2FReflecT/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CubeEngine%2FReflecT/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CubeEngine%2FReflecT/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/CubeEngine","download_url":"https://codeload.github.com/CubeEngine/ReflecT/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248166928,"owners_count":21058480,"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":["config","cubeengine","java","library"],"created_at":"2024-11-24T06:13:13.550Z","updated_at":"2025-04-10T05:51:44.170Z","avatar_url":"https://github.com/CubeEngine.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"![Reflec\u003cT\u003e](https://github.com/CubeEngineDev/ReflecT/blob/master/ReflectT.png?raw=true)\n=========\n\nTypesafe serialization of data\n\n[![Maven Central](https://maven-badges.herokuapp.com/maven-central/de.cubeisland.engine/reflect/badge.svg?style=flat)](http://mvnrepository.com/artifact/de.cubeisland.engine/reflect) (replace ```${reflectVersion}``` with this version)\n\n[![Build Status](https://travis-ci.org/CubeEngine/ReflecT.svg?branch=master)](https://travis-ci.org/CubeEngine/ReflecT)\n\n# Using the library\n\n## Dependencies\n\n### Maven\n\nTo add the dependency using Maven just add the following section to your dependencies:\n```xml\n\u003cdependency\u003e\n    \u003cgroupId\u003ede.cubeisland.engine\u003c/groupId\u003e\n    \u003cartifactId\u003ereflect\u003c/artifactId\u003e\n    \u003cversion\u003e${reflectVersion}\u003c/version\u003e\n\u003c/dependency\u003e\n```\n\n### Gradle\n\nTo add the dependency using Gradle just add the following line to your dependencies:\n```groovy\ncompile 'de.cubeisland.engine:reflect:${reflectVersion}'\n```\n\n## Dependencies for Android\n\nUsing this library with Android is a little more difficult as the snakeyaml dependency \ndoesn't work with Android. Nevertheless you can use it by following these steps:\n\n1. download the snakeyaml-android.jar from this page: [snakeyaml-android](http://code.google.com/p/snakeyaml/downloads/detail?name=snakeyaml-android-1.8-SNAPSHOT.jar\u0026can=2\u0026q=)\n2. copy the file to your project/module\n3. add the following section to your dependencies:\n    * Maven:\n    \n    ```xml\n    \u003cdependency\u003e\n        \u003cgroupId\u003ede.cubeisland.engine\u003c/groupId\u003e\n        \u003cartifactId\u003ereflect\u003c/artifactId\u003e\n        \u003cversion\u003e${reflectVersion}\u003c/version\u003e\n        \u003cexclusions\u003e\n            \u003cexclusion\u003e\n                \u003cgroupId\u003eorg.yaml\u003c/groupId\u003e\n                \u003cartifactId\u003esnakeyaml\u003c/artifactId\u003e\n            \u003c/exclusion\u003e\n        \u003c/exclusions\u003e\n    \u003c/dependency\u003e\n    \u003cdependency\u003e\n        \u003cartifactId\u003eorg.yaml\u003c/artifactId\u003e\n        \u003cgroupId\u003esnakeyaml\u003c/groupId\u003e\n        \u003cversion\u003e1.14\u003c/version\u003e\n        \u003cscope\u003esystem\u003c/scope\u003e\n        \u003csystemPath\u003e${basedir}/RELATIVE_PATH_TO_SNAKEYAML_ANDROID_JAR\u003c/systemPath\u003e\n    \u003c/dependency\u003e\n    ```\n    * Gradle:\n    \n    ```groovy\n    compile ('de.cubeisland.engine:reflect:${reflectVersion}')\n    {\n        exclude group: 'org.yaml', module: 'snakeyaml'\n    }\n    compile files('RELATIVE_PATH_TO_SNAKEYAML_ANDROID_JAR')\n    ```\n\n(Please note: edit the \"RELATIVE_PATH_TO_SNAKEYAML_ANDROID_JAR\" part!)\n\n## Usage example (in a Bukkit plugin) as a Configuration\n```java\npublic class ExamplePlugin extends JavaPlugin\n{\n    // Create the Factory\n    private Reflector factory = new Reflector();\n\n    private MyConfig config;\n\n    public void onEnable()\n    {\n        File file = new File(this.getDataFolder(), \"config.yml\");\n\n        // load the reflected using the factory (this will also save after loading)\n        config = factory.load(MyConfig.class, file);\n\n        // at any time you can reload the reflected object\n        config.reload(); // this will also save the reflected object!\n        // or save the reflected object\n        config.save();\n    }\n\n    // The Reflected Class\n    public class MyConfig extends ReflectedYaml // this is the same as extends Reflected\u003cYamlCodec\u003e\n    {\n        public transient boolean noSaving; // fields that are transient are ignored\n\n        // the path is generated from the field: lots-of-saving\n        public boolean lotsOfSaving = true; // set default values (will be set if not loaded OR field is missing in file)\n\n        @Name(\"default\")\n        public String defaultString = \"You can define the path with an annotation instead. e.g. if you want to use \\\"default\\\"\";\n\n        // path will be: sub.section\n        @Comment({\"You can comment every field.\",\"Even with multiple lines\\nand this linebreak works too\"})\n        public SubSection sub_section; // You do not NEED to set the default here ; it is done automatically\n\n        // You can use sections instead of setting the whole path for every field\n        public class SubSection implements Section\n        {\n            // path will be: sub.section.an-int\n            public int anInt = 42;\n            // path will be: sub.section.a-long\n            public long aLong = 666;\n        }\n    }\n}\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcubeengine%2Freflect","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcubeengine%2Freflect","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcubeengine%2Freflect/lists"}