{"id":24302881,"url":"https://github.com/digipolitan/java-code-writer","last_synced_at":"2025-03-06T14:26:53.623Z","repository":{"id":98675473,"uuid":"100692124","full_name":"Digipolitan/java-code-writer","owner":"Digipolitan","description":null,"archived":false,"fork":false,"pushed_at":"2017-11-13T20:49:57.000Z","size":49,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":4,"default_branch":"master","last_synced_at":"2025-01-17T00:20:13.541Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Swift","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"bsd-3-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Digipolitan.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","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":"2017-08-18T08:43:37.000Z","updated_at":"2017-10-03T13:22:53.000Z","dependencies_parsed_at":"2023-06-07T09:36:38.673Z","dependency_job_id":null,"html_url":"https://github.com/Digipolitan/java-code-writer","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Digipolitan%2Fjava-code-writer","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Digipolitan%2Fjava-code-writer/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Digipolitan%2Fjava-code-writer/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Digipolitan%2Fjava-code-writer/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Digipolitan","download_url":"https://codeload.github.com/Digipolitan/java-code-writer/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":242225896,"owners_count":20092670,"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":[],"created_at":"2025-01-17T00:19:58.202Z","updated_at":"2025-03-06T14:26:53.618Z","avatar_url":"https://github.com/Digipolitan.png","language":"Swift","funding_links":[],"categories":[],"sub_categories":[],"readme":"JavaCodeWriter\n=================================\n\n[![Swift Version](https://img.shields.io/badge/swift-4.0-orange.svg?style=flat)](https://developer.apple.com/swift/)\n[![Swift Package Manager](https://rawgit.com/jlyonsmith/artwork/master/SwiftPackageManager/swiftpackagemanager-compatible.svg)](https://swift.org/package-manager/)\n[![Twitter](https://img.shields.io/badge/twitter-@Digipolitan-blue.svg?style=flat)](http://twitter.com/Digipolitan)\n\nLibrary to write java source code\n\n## Installation\n\n### SPM\n\nTo install JavaCodeWriter with SwiftPackageManager, add the following lines to your `Package.swift`.\n\n```swift\nlet package = Package(\n    name: \"XXX\",\n    products: [\n        .library(\n            name: \"XXX\",\n            targets: [\"XXX\"]),\n    ],\n    dependencies: [\n        .package(url: \"https://github.com/Digipolitan/ode-writer.git\", from: \"1.0.0\")\n    ],\n    targets: [\n        .target(\n            name: \"XXX\",\n            dependencies: [\"JavaCodeWriter\"])\n    ]\n)\n```\n\n## The Basics\n\nYou must create a file description that represent the java output file with the given following type\n- class `ClassDescription`\n- enum `EnumDescription`\n- protocol `InterfaceDescription`\n\n```swift\n// Create a User class with 2 fields\nvar cd = ClassDescription(name: \"User\", options: .init(visibility: .public))\ncd.fields.append(.init(name: \"lastName\", type: \"String\"))\ncd.fields.append(.init(name: \"firstName\", type: \"String\"))\nlet fileDescription = FileDescription(classDescription: cd, package: \"com.digipolitan.user\")\n```\n\nAfter that use the FileWriter to transform the given FileDescription to string as follow\n\n```swift\nlet res = FileWriter.default.write(description: fileDescription)\n```\n\n## Contributing\n\nSee [CONTRIBUTING.md](CONTRIBUTING.md) for more details!\n\nThis project adheres to the [Contributor Covenant Code of Conduct](CODE_OF_CONDUCT.md).\nBy participating, you are expected to uphold this code. Please report\nunacceptable behavior to [contact@digipolitan.com](mailto:contact@digipolitan.com).\n\n## License\n\nJavaCodeWriter is licensed under the [BSD 3-Clause license](LICENSE).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdigipolitan%2Fjava-code-writer","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdigipolitan%2Fjava-code-writer","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdigipolitan%2Fjava-code-writer/lists"}