Hi Mario, When you serialize an object in writeObject method you must be serializing its attributes in some order.
When you deserialize it in readObject method, you read back all the attributes. Then in the readObject method you can: 1. create the object with argless ctr and set the read attributes one by one using setters Or 2. Based on the values of the read attributes you can invoke the appropriate ctr. Basically how you deserialize an object depends on how you chose to serialize it. You may use key value pairs to serialize an object. Thanks and regards, Janak >-----Original Message----- >From: [EMAIL PROTECTED] >[mailto:[EMAIL PROTECTED] Behalf Of Mario H. >Castillo >Sent: Friday, October 06, 2006 2:03 AM >To: [EMAIL PROTECTED] Com >Subject: [ULC-developer] Multiple constructor code > > >Hi Janak, > >How would I write a coder for a class with multiple constructor. >Do I have >to add setters and getters? > >public class DynamicListEditor extends EditableStringListEditor >{ > private ArrayList RefList= new ArrayList(); > > public DynamicListEditor(List<StringEntry> list) { > } > public DynamicListEditor(boolean lazyInitialization, List<StringEntry> >list) { > } > public DynamicListEditor(boolean lazyInitialization, List<StringEntry> >list, List<ULCIcon> icons) { > } >} > >public class DynamicListEditorCoder implements IStreamCoder { > > public String getPeerClassName() { > return DynamicListEditor.class.getName(); > } > > public void writeObject(IObjectOutputStream out, Object data) { > DynamicListEditor c = (DynamicListEditor)data; > > try { > } catch (IOException e) { > e.printStackTrace(); //To change body of catch statement use >File | Settings | File Templates. > } > } > > public Object readObject(IObjectInputStream in) throws IOException { > // Which parameters to use and which constructor???? > > return new DynamicListEditor(????); > } >} > >Mario >Abacus Research > >_______________________________________________ >ULC-developer mailing list >[email protected] >http://lists.canoo.com/mailman/listinfo/ulc-developer _______________________________________________ ULC-developer mailing list [email protected] http://lists.canoo.com/mailman/listinfo/ulc-developer
