HI guys,
I would like to create a Java file based on the information from an XML file. I would like to read the info from an xml and generate a class and it's method.
e.g
<person>
<name>croc</name>
<surname>crocky</surname>
<age>12</age>
</person>
then it should generate:
public class Person {
private String name = "";
private String surname = "";
private int age = 0;
/**
* @return the name
*/
public String getName() {
return name;
}
/**
* @param name the name to set
*/
public void setName(String name) {
this.name = name;
}
/**
* @return the surname
*/
public String getSurname() {
return surname;
}
/**
* @param surname the surname to set
*/
public void setSurname(String surname) {
this.surname = surname;
}
/**
* @return the age
*/
public int getAge() {
return age;
}
/**
* @param age the age to set
*/
public void setAge(int age) {
this.age = age;
}
}
I know how to read information from an xml. what i need is to generate a class and it's methods.
Thanks
Croc85