There is XML with this structure:
<?xml version="1.0" encoding="UTF-8" standalone="no"?> <object type="People"> <field id="name" type="class java.lang.String" value="Ivan"/> <field id="age" type="class java.lang.Integer" value="23"/> <field id="salary" type="double" value="50.0"/> </object> But the type of the object and the field may differ. For example, the file might be:
<object type="Worker"> <field id="lastName" type="class java.lang.String" value="Ivan"/> <field id="height" type="double" value="170.00"/> <field id="salary" type="double" value="50.0"/> </object> Is it possible to create an object from a similar document?
<object type="тут"as a regular string. Now the variables themselves are with data. You can rip ajava.lang.Stringtype string and create a class from it viaClass.forName()- Flippyint,double,String. We take each type as a string and check it with "hands". Ifjava.lang.String, then take the value and shove it into a variable, calling it in advance like in the file - Flippy