classpath
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

RE: Some object serialization problems for discussion(2)-Throwabl e


From: Wu, Gansha
Subject: RE: Some object serialization problems for discussion(2)-Throwabl e
Date: Mon, 6 Aug 2001 09:46:15 +0800

Hi, Brian,
      You're right. Exception will be thrown if field is null, I mean to put a 
mapping between local field name and serialized field name, e.g, in 
writeObject():
           ... ...
           oFields.put("message", "detailMessage", message);
           That means that a local field message will be serialized into the 
name of "detailMessage", then the serialized stream could be accessed by JDK 
like we've supposed.
           And of course, we will deal with it in readObject():
          ... ...
           oFields.get("message", "detailMessage", (String)null);

      It's just a suggestion for considering.

Best regards...
Gansha  

>>       So I wonder if here we could add some mapping mechanisms to map real 
>> field names 
>> to serialized strings, e.g: add a member function like:
>> 
>>      public void put (String field_name, String serialized_name, Object 
>> value)
>>        throws IOException, IllegalArgumentException
>>        Let Throwable be wise about the mapping when doing stuff in 
>> readObject/writeObject.
>>  I wonder if it will bring more issues in ObjectInputStream.

> Is this all to say that ObjectStreamClass.getField (String) can return
> null, such that the line 

> objs[field.getOffset ()] = value;

> throws an exception?

> I don't understand the mapping problem you're talking about.

> Brian



reply via email to

[Prev in Thread] Current Thread [Next in Thread]