Skip to content

A light-weight java pojo generator from json, made from scratch, using Java

License

Notifications You must be signed in to change notification settings

mdnaimur0/json2javapojo

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

JSON to Java Pojo Generator

A light-weight and simple project to generate Java pojo classes from JSON.

Here is how to use:

  • First build the options as you need
Options options = new Options.Builder()
	.isIncludeConstructors(true)
	.isUsePrimitiveType(true)
	.isIncludeSetter(true)
	.setAnnotationStyle(new GsonAnnotationStyle())
	.build();
  • Then generate your desired pojo class
Json2JavaPojo javaPojo = new Json2JavaPojo.Builder()
	.setClassName("MyClass")
	.setPackageName("com.example.models")
	.setSource("put-your-json-here")
	.setOptions(options)
	.build();
	
String pojoClassCode = javaPojo.generate();
System.out.println(pojoClassCode);

About

A light-weight java pojo generator from json, made from scratch, using Java

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages