I want to read a properties file and create a pojo from it. where the property key is the instance variable with getters and setters. and property value is the data type of the instance variable. input would be something like this
className=Temp
packageName=com.temp
name=java.lang.String
output would be
package com.temp;
import java.lang.String;
class Temp{
private String name
//getters and setters
}
what is the easiest way to do this. Should I create a file and write to it .or is there a better way.
I once generated Java file using Apache Velocity , you may want to take a look into it.
In short you template a file then use it to generate what you want.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With