Project

j2j

0.02
No commit activity in last 3 years
No release in over 3 years
Convert any Files.json to corresponding Classe.java files
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
2025
 Dependencies

Development

~> 1.10
>= 0
~> 10.0

Runtime

~> 0.7
~> 1.8.3
~> 0.19.1
 Project Readme

j2j Gem Version

Convert any Files.json to corresponding Classe.java files

Installation

$ gem install j2j

Usage

$ j2j ~/sample.json -o ~/destination_folder

sample.json:

{
  "total": 2,
  "people": [
    { "name": "jose" },
    { "name": "maria" }
  ]
}

Lets look at the ~/destination_folder...

The files Sample.java and Person.java were created

Sample.java:

public class Sample {

  private Long total;
  private List<Person> people;

  public Long getTotal() { return total; }
  public void setTotal(Long total) { this.total = total; }
  public List<Person> getPerson() { return people; }
  public void setPerson(List<Person> people) { this.people = people; }

}

Person.java:

public class Person {

  private String name;

  public String getName() { return name; }
  public void setName(String name) { this.name = name; }

}

... and you're golden :)

Advanced

Param Shortcut Default value Usage
root_class -r Example.java $ j2j ~/file.json -r Person
package -p com.example $ j2j ~/file.json -p com.company
output -o out $ j2j ~/file.json -o src/

Complete example:

$ j2j ~/file.json -r Person -p com.compay -o src/

Contributing

Bug reports and pull requests are welcome on GitHub at https://github.com/cesarferreira/j2j.