If we know the structure of the object the with help of "useAttributeFor" method and aliases we can mapped the same tag name and class variable. But my requirement is that convert the xml file to object without knowing the object structure. For Example we hava a xml file test.xml with contect as:
<test>
<Name>John</Name>
<age>18</age>
</test>
Now I need to convert this xml file into object. My Java Class will be like:
public class Test
{
private String Name;
private int age;
public void setName(String Name,int age)
{
this.Name = Name;
this.age = age;
}
public void display()
{
System.out.println("Name: "+Name);
System.out.println("Age: "+age);
}
}
I'm new to this so please help me out and thank you all in advance