https://github.com/ktonon/json2java
Sample project which demonstrates how cog could be used to convert json data into Java classes
https://github.com/ktonon/json2java
Last synced: 19 days ago
JSON representation
Sample project which demonstrates how cog could be used to convert json data into Java classes
- Host: GitHub
- URL: https://github.com/ktonon/json2java
- Owner: ktonon
- Created: 2013-03-25T23:55:45.000Z (over 12 years ago)
- Default Branch: master
- Last Pushed: 2013-03-26T00:40:16.000Z (over 12 years ago)
- Last Synced: 2025-03-04T06:13:49.570Z (4 months ago)
- Language: Ruby
- Size: 105 KB
- Stars: 4
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
Example json2java Generator using cog
=====================================This simple project demonstrates how to use [cog][] to generate Java classes from
data stored in json files.To play with this example install cog
```
$ gem install cog
```edit the `json/sample.json` file and re-run the generator to update `src/Sample.java`
```
$ cog gen
```The code which reads the JSON and writes the Java file is located in `cog/generators/json2java.rb`. It makes use of an ERB template located in `cog/templates/javaClass.java.erb`
[cog]: https://github.com/ktonon/cog