{"id":13343307,"url":"https://github.com/HituziANDO/YAMLParserJava","last_synced_at":"2025-03-12T04:33:11.568Z","repository":{"id":18243394,"uuid":"21392956","full_name":"HituziANDO/YAMLParserJava","owner":"HituziANDO","description":"YAML decoder in Java.","archived":false,"fork":false,"pushed_at":"2019-01-04T16:23:51.000Z","size":15,"stargazers_count":3,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-01-21T00:51:12.161Z","etag":null,"topics":["decoder","java","parser","yaml"],"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/HituziANDO.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}},"created_at":"2014-07-01T15:30:24.000Z","updated_at":"2023-11-27T01:02:35.000Z","dependencies_parsed_at":"2022-08-04T23:16:17.194Z","dependency_job_id":null,"html_url":"https://github.com/HituziANDO/YAMLParserJava","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/HituziANDO%2FYAMLParserJava","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/HituziANDO%2FYAMLParserJava/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/HituziANDO%2FYAMLParserJava/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/HituziANDO%2FYAMLParserJava/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/HituziANDO","download_url":"https://codeload.github.com/HituziANDO/YAMLParserJava/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243158974,"owners_count":20245668,"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":["decoder","java","parser","yaml"],"created_at":"2024-07-29T19:31:08.114Z","updated_at":"2025-03-12T04:33:11.323Z","avatar_url":"https://github.com/HituziANDO.png","language":"Java","readme":"# YAMLParserJava\n\n***YAML decoder in Java.***\n\n## Include in your project\n\n1. Puts `src/HashTypeYaml.java` in your project\n1. Sets any package to HashTypeYaml.java\n\n## Usage\n\nFor example, decodes following YAML as test1.yml file.\n\n```yaml\ntest1:\n  id: 1234\n  country: \"Japan\"\n  code:\n  data:\n    users:\n      - Alice\n      - Bob\n      - Chris\n    title: \"ABC Team\"\n    description: \"ABC Team is the best!\"\n```\n\n1. Create instance\n\t\n\t```java\n\tHashTypeYaml yaml = new HashTypeYaml();\n\t```\n\n1. Decode YAML and convert to Map object\n\t\n\t```java\n\ttry {\n\t    Map\u003cString, Object\u003e map = yaml.decode(new FileInputStream(\"test1.yml\"));\n\t} catch (IOException e) {\n\t    // Error handling\n\t}\n\t```\n\t\n\tOr\n\t\n\t```java\n\tMap\u003cString, Object\u003e map = yaml.decodeOrEmpty(\"test1.yml\");\n\t```\n\t\n\t`decodeOrEmpty` does not raise the exception and returns empty map if I/O error is occurred.\n\n1. Get value\n\t\n\t```java\n\t// Get id.\n\tSystem.out.println(map.get(\"test1/id\"));   // =\u003e 1234\n\t\n\t// Get title.\n\tSystem.out.println(map.get(\"test1/data/title\"));   // =\u003e ABC Team\n\t\n\t// Get users.\n\tList users = (List) map.get(\"test1/data/users\");\n\tSystem.out.println(users.get(1));   // =\u003e Bob\n\t```\n\nMore info, see my [sample code](https://github.com/HituziANDO/YAMLParserJava/blob/master/src/Main.java).\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FHituziANDO%2FYAMLParserJava","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FHituziANDO%2FYAMLParserJava","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FHituziANDO%2FYAMLParserJava/lists"}