dcsimg
readObject() functionality in XMLDecoder?
0 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   Arno_Engelbrecht
Posted On:   Friday, July 12, 2002 05:36 AM

I am using XMLEncoder/XMLDecoder to serialize my objects. However, I am now missing the Object.readObject(ObjectInputStream ois) functionality. With the previous form of serialization (with ObjectInputStream) I could override this method in the Object I am de-serialising in order to do some required customization of the object when it is de-serialised E.g. private void readObject(ObjectInputStream s) throws ClassNotFoundException,IOException { s.defaultReadObject(); //Manipulate the object here // Some code } The XMLDecoder doesn't seem to call this method when de-seri   More>>

I am using XMLEncoder/XMLDecoder to serialize my objects.

However, I am now missing the Object.readObject(ObjectInputStream ois) functionality. With the previous form of serialization (with ObjectInputStream) I could override this method in the Object I am de-serialising in order to do some required customization of the object when it is de-serialised


E.g.

			
private void readObject(ObjectInputStream s) throws ClassNotFoundException,IOException


{


s.defaultReadObject();



//Manipulate the object here


// Some code


}



The XMLDecoder doesn't seem to call this method when de-serializing my Object. Is there any way for me to manipulate the de-serialized object when the XMLDecoder reads it?


Thank you



Please use html tags to format code blocks.

   <<Less
About | Sitemap | Contact