• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Converting Java to XML file

 
Parameswaran Thangavel
Ranch Hand
Posts: 485
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi all
i am looking for a tool which do the below requirement.

Given the Java file, it will generate the XML file for that java file.

say java class like

Class Student{
private int age;
private String Name;
private char Sex;

}


the output i am expecting is

<Student>
<age></age>
<Name></Name>
<Sex></Sex>
</Student>

I donno whether there might me one. but i want to convert the exisitng java class to XML file as said above. since i am having numerous java file i am looking for the tool of above kind.
 
Ulf Dittmer
Rancher
Pie
Posts: 42966
73
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
If the class conforms to the Beans specification, then you can use the java.beans.XMLEncoder/Decoder classes. Otherwise, have a look at libraries like XMLBeans.
 
Jesper de Jong
Java Cowboy
Saloon Keeper
Pie
Posts: 15150
31
Android IntelliJ IDE Java Scala Spring
 
dennis zined
Ranch Hand
Posts: 330
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Castor is your friend...
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic