commons-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Catalin Grigoroscuta <c.grigorosc...@moodmedia.ro>
Subject Re: Serialize and deserialize object to and from text
Date Thu, 28 Apr 2005 07:15:25 GMT
Hi,

Have you considered using the java.beans.XMLEncoder/XMLDecoder classes 
(JDK 1.4)?
Or, if you are just interested in "text encoder/decoder", without being 
human readable, you could just serialize and the encode Base64 (Base64 
encoder/decoder exists in one of jakarta projects, I do not remember 
which one).

Catalin

>>Hi,
>>
>>I am looking for a text encoder and text decoder for object 
>>serialization and deserialization.  Anyone has worked on such a tool 
>>before, and can share the source code?
>>
>>I have the encoder working using recursion and reflection, but I don't 
>>have a clue on the way to use recursion and reflection to read the text 
>>back to Java beans.  In fact, I have been trying to build the decoder 
>>for weeks, and have been stucked on the case where the object contain a 
>>collection of objects.
>>
>>The encoder I have built have the following text output:
>>
>>{book:Book={{name:java.lang.String="Hitchhiker 
>>Guide"}{author:Author={{name:java.lang.String="Edmond 
>>Wong"}{email:java.lang.String="edmond.wong@pacbell.net"}{address:java.lang.String="123
 
>>Olive 
>>Ave"}}}{price:double=49.99}{chapters:java.util.Vector={{chapter:Chapter={{no:int=1}{name:java.lang.String="Act

>>I"}}}{chapter:Chapter={{no:int=2}{name:java.lang.String="Act 
>>II"}}}{chapter:Chapter={{no:int=3}{name:java.lang.String="Act III"}}}}}}}
>>
>>Thanks,
>>
>>Edmond
>>
>>---------------------------------------------------------------------
>>To unsubscribe, e-mail: commons-user-unsubscribe@jakarta.apache.org
>>For additional commands, e-mail: commons-user-help@jakarta.apache.org
>>    
>>

---------------------------------------------------------------------
To unsubscribe, e-mail: commons-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-user-help@jakarta.apache.org


Mime
View raw message