Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/kikuchy/genum
Generate Java Enum class from YAML
https://github.com/kikuchy/genum
Last synced: 1 day ago
JSON representation
Generate Java Enum class from YAML
- Host: GitHub
- URL: https://github.com/kikuchy/genum
- Owner: kikuchy
- License: apache-2.0
- Created: 2015-10-26T16:03:17.000Z (about 9 years ago)
- Default Branch: master
- Last Pushed: 2015-11-04T08:52:50.000Z (about 9 years ago)
- Last Synced: 2024-12-20T05:02:58.687Z (6 days ago)
- Language: Java
- Homepage:
- Size: 238 KB
- Stars: 3
- Watchers: 1
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Genum - Generate Enum from YAML
[![Build Status](https://travis-ci.org/kikuchy/genum.svg)](https://travis-ci.org/kikuchy/genum)
Genum is the code generator that generate Java enum class file from YAML array.
You can share the definition between server side and client application!
For example, here is a array written in YAML format.
```yaml
- Tokyo
- NewYork
- London
- Beijing
- Paris
- Roma
```Genum turns it into Enum java file.
```java
package com.example;public enum City {
TOKYO,NEW_YORK,
LONDON,
BEIJING,
PARIS,
ROMA
}
```## Usage
### CLI tool
Download [latest cli tool](https://github.com/kikuchy/genum/releases) and unzip it.
```
$ ./bin/genus-cli -c City -p com.example -s cities.yml -o your/project/src/main/java
```
Run without any option to show command line option discription.```
-c (--class-name) VAL : Class name of Enum class.
-o (--output) FILE : Destination directory. Package directory will make
automatically.
-p (--package-name) VAL : Package name that used for 'package' statement.
-s (--source) FILE : Source YAML file.
```### Library
Download [latest library](https://github.com/kikuchy/genum/releases) and unzip it.
_Maybe, Genum will be registed to Maven Central._
## It's inspired from...
- [jsonschema2pojo](http://www.jsonschema2pojo.org)
## License
```
Copyright 2015 kikuchyLicensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License athttp://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
```