{"id":19146520,"url":"https://github.com/kahsolt/ifyaml","last_synced_at":"2025-09-06T22:37:31.046Z","repository":{"id":113306662,"uuid":"166444242","full_name":"Kahsolt/IfYaml","owner":"Kahsolt","description":"A simplified yaml library in java that only supports a limited minimized YAML grammar...","archived":false,"fork":false,"pushed_at":"2019-01-21T08:55:50.000Z","size":37,"stargazers_count":1,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-07-07T22:14:05.631Z","etag":null,"topics":["builder-generator","configuration","configuration-file","framework","yaml"],"latest_commit_sha":null,"homepage":null,"language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"wtfpl","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Kahsolt.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}},"created_at":"2019-01-18T17:03:05.000Z","updated_at":"2019-09-30T15:39:38.000Z","dependencies_parsed_at":null,"dependency_job_id":"de39489d-bc23-43fa-a21f-ea5af1b98f36","html_url":"https://github.com/Kahsolt/IfYaml","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/Kahsolt/IfYaml","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Kahsolt%2FIfYaml","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Kahsolt%2FIfYaml/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Kahsolt%2FIfYaml/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Kahsolt%2FIfYaml/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Kahsolt","download_url":"https://codeload.github.com/Kahsolt/IfYaml/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Kahsolt%2FIfYaml/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":273973968,"owners_count":25200578,"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-09-06T02:00:13.247Z","response_time":2576,"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":["builder-generator","configuration","configuration-file","framework","yaml"],"created_at":"2024-11-09T07:44:28.607Z","updated_at":"2025-09-06T22:37:31.014Z","avatar_url":"https://github.com/Kahsolt.png","language":"Java","readme":"# IfYaml\r\n\r\n    A simplified yaml library in java that only \r\n    supports a limited minimized YAML grammar...\r\n\r\n\r\n## NOTICE:\r\n  - IfYaml is a micro-subset of compatible YAML, so please take care of your INDENTS if you read in other YAML file or edit manually\r\n  - This library is meant to guarantee the idempotence of it's IO (see `IfYamlTest.testDumper() / IfYamlTest.testBuilder()`)\r\n\r\n### Quick Start\r\n```java\r\npublic class IfYamlTest extends Test { \r\n    private void testYaml() {\r\n        Yaml config = new Yaml(exampleFile);\r\n        config.set(\"I.hate\", \"Yaml\");\r\n        config.set(\"I.love\", \"Java\");\r\n        config.set(\"I.love\", \"Ruby\");   // overwrite\r\n        config.set(\"You.are\", \"Foolish\");\r\n        config.save();\r\n\r\n        config.reload();\r\n        assert \"Yaml\".equals(config.getString(\"I.hate\"));\r\n        assert \"Ruby\".equals(config.getString(\"I.love\"));\r\n        assert \"Foolish\".equals(config.getString(\"You.are\"));\r\n        assert null == config.getString(\"no.where\");\r\n        assert \"novalue\".equals(config.getString(\"no.where\", \"novalue\"));\r\n    }\r\n}\r\n```\r\nYou can learn more from [test.yml](/src/main/resources/test.yml) and [IfYamlTest.java](/src/test/java/IfYamlTest.java)\r\n\r\n### Developer Quick Reference\r\n```markdown\r\n  - parse\r\n    - Parser: parse YAML string to create AST tree\r\n    - Dumpder: dump AST tree to YAML string\r\n    - Builder: build any structurized Object to AST tree\r\n  - tree\r\n    - xNode: low level API concerning AST tree nodes\r\n    - Tree: high level API operating on AST tree by path\r\n  - util\r\n    - StringEx: easydoing some string/text editing work \r\n    - Test*: hyperlight unittest framework :(\r\n  - Yaml: the frontend = parser + AST tree + dumper\r\n```\r\n\r\n### features\r\n  - accept minimized subset of pure block-style YAML grammar, indent \u0026 alignment are VERY sensitive; grammar in short:\r\n    - types\r\n      - natively support 10 data types: bool/byte/char/short/int/long/float/double/string*/datetime\r\n      - string* type stands for 3 variants: string/multiline/text\r\n    - structures\r\n      - hash: recoginzed by `keyname: `\r\n      - list: recoginzed by `- `\r\n    - full-line comment (retention supported)\r\n        - 注释只能是整行的，前导空格用于计数缩进层次，即`regex(\"^ *#.*$\")`，e.g. \"# This is a full line.\"\r\n        - 注释向下黏著于最近的哈希键/列表项/值，且必须与被黏着的键项统一缩进；找不到合适黏着关系的孤儿注释会被删除掉\r\n        - 多行文本即管道符号后文本中的注释符号不起作用，优先解释为多行文本内容而不是单行注释\r\n        - 不建议在多段文本中使用分散的注释，否则会被聚合起来上移\r\n  - CRUD operations via path (e.g. \"Database.0.ConnectionPool.MaxConnection\")\r\n    - HashNode: section name is the key\r\n    - ListNode: section name is the index number\r\n\r\n----\r\n\r\nby kahsolt\r\n2019/01/15","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkahsolt%2Fifyaml","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkahsolt%2Fifyaml","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkahsolt%2Fifyaml/lists"}