Reputation: 4090
Using java, I am trying to read XML nodes and attributes, and then create a specific language (smv language) file by using those nodes and the relation between the nodes. Lets say I have an XML classes as following (please don't mind the xml structure and/or java code, it is just for clarifying the case) Lets say the xml file is Person.xml
<person>
<name type='string'>John</name>
<age type='int'>25</age>
</person>
Then I will read that XML file and create a proper java classes lets say Person.java,
class Person
{
string name="John";
int age=25;
}
I just wondered, do you know is there any specific pattern or any good aproach to manage such a project? What would you advice for that case?
Many Thanks
Upvotes: 0
Views: 395
Reputation: 17066
The process of converting a programming language object to a textual representation is called serialization or marshalling. The reverse (text to object) is called deserialization or unmarshalling.
There are several popular Java tools to accomplish this. See: XML serialization in Java?
Upvotes: 1