![]() |
|
|
|
|
|
|
2
21st October 00:09
External User
Posts: 1
|
Not sure when you say "nothing prints" if you mean the file is empty, or
has an empty XML element. The former implies I/O error -- any errors in your log? The latter can be a number of things. But here are some points to consider. First, this isn't real test code since it calls getDriver() instead of getDriverClass(). Always post the real code you ran. Second, I don't think you can write more than one object. The output is a complete XML root and only one root is allowed per file. If you want the file to contain a list of ConnProperty objects, just write the list itself. The Encoder will dump the list in XML and all it's parts. Very neat and simple. No loop on your part. Third, why are you copying the object before serializing? Just curious. Fourth, don't forget that if your object only has default data, nothing default constructor can take care of. So a default object is not a good test case. Hope this helps. timasmith@hotmail.com wrote: |
|
|
4
21st October 00:09
External User
Posts: 1
|
Design trade-off. The API says it uses a "redundancy elimination
algorithm," which is summarized in 2 sentences at http://java.sun.com/products/jfc/tsc...stence4/#intro The goal is to reduce how much is read and written. There are lots of ways changing your class could break things later on when decoding, so they may have felt it was a lost cause trying to prevent that. |
|