• Post Reply Bookmark Topic Watch Topic
  • New Topic

Seralization or what to do ?  RSS feed

 
Marin IvandiC
Greenhorn
Posts: 19
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hey,

I'm building GUI and hole app is going to read and rewirte on xml file..

First I make function for read and write and they are working, but now I decide to make one class where I'm going to have get and set.. This is my class wehre I need to read everything from xm

This is my function for reading

And this is my code for writing(creating xml with same nodes and attributes)




Now my idea is when I start app that everythinf from xml is going to read from xml and trough get is going to show on my interfacei, when I edit I'm going to save and with function create I'm going to make same xml file with different paramters... Idea how to make something or how to use serialization
 
K. Tsang
Bartender
Posts: 3648
16
Firefox Browser Java Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I don't think you need serialization here. Serialization is for storing objects.

Since you are working with files, simple I/O should be enough. In traditional I/O sense, XXXReader and XXXWriter will do but you are working with XML files so you need to JAXP (javax.xml) API

Have a look at Java tutorials here for one approach.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!