Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.java.programmer > #7677

Re: De-serializing an object with missing child classes

Path csiph.com!x330-a1.tempe.blueboxinc.net!newsfeed.hal-mli.net!feeder3.hal-mli.net!nx02.iad01.newshosting.com!newshosting.com!69.16.185.21.MISMATCH!npeer03.iad.highwinds-media.com!news.highwinds-media.com!feed-me.highwinds-media.com!postnews.google.com!hb5g2000vbb.googlegroups.com!not-for-mail
From "raphfrk@gmail.com" <raphfrk@gmail.com>
Newsgroups comp.lang.java.programmer
Subject Re: De-serializing an object with missing child classes
Date Wed, 7 Sep 2011 07:14:47 -0700 (PDT)
Organization http://groups.google.com
Lines 16
Message-ID <4d1a98fa-bef3-45d5-97c3-3df29265ffe1@hb5g2000vbb.googlegroups.com> (permalink)
References <774ae53e-c127-4d79-8267-d8c8197d0dfb@z7g2000vbp.googlegroups.com> <a8c55b80-c7c2-4eaa-90b3-019fffe037ce@a13g2000yqd.googlegroups.com> <9651530b-9ed9-41cc-b686-b0644226a65a@a31g2000vbt.googlegroups.com> <9coeqfFfujU1@mid.individual.net>
NNTP-Posting-Host 137.71.226.54
Mime-Version 1.0
Content-Type text/plain; charset=ISO-8859-1
Content-Transfer-Encoding quoted-printable
X-Trace posting.google.com 1315406479 10029 127.0.0.1 (7 Sep 2011 14:41:19 GMT)
X-Complaints-To groups-abuse@google.com
NNTP-Posting-Date Wed, 7 Sep 2011 14:41:19 +0000 (UTC)
Complaints-To groups-abuse@google.com
Injection-Info hb5g2000vbb.googlegroups.com; posting-host=137.71.226.54; posting-account=iOAcbgoAAADC8J1iW-JMMSO74f5TboSg
User-Agent G2/1.0
X-Google-Web-Client true
X-Google-Header-Order HUALESNKRC
X-HTTP-UserAgent Mozilla/5.0 (X11; U; Linux i686 (x86_64); en-US; rv:1.9.2.3) Gecko/20100401 Firefox/3.6.3,gzip(gfe)
Xref x330-a1.tempe.blueboxinc.net comp.lang.java.programmer:7677

Show key headers only | View raw


On Sep 7, 6:46 am, Robert Klemme <shortcut...@googlemail.com> wrote:
> I am not sure I get exactly what you mean here.  Do you want to
> resurrect class objects (i.e. the code) from the stream?  I don't think
> this is possible without complex logic.

I was thinking that the standard deserializer might be a relatively
low complexity recursive method.  It may be possible to copy that and
update it where it checks for a class match.

In the end I just had the custom reader use the defaultReadObject()
method and then read again.  If it hit EOF, then I assumed that it was
the old type.  Otherwise it read the extra info and updated
accordingly.

When read, it stored the child objects as either a byte array stored
in a dummy object or as the actual object if it could be deserialized.

Back to comp.lang.java.programmer | Previous | NextPrevious in thread | Next in thread | Find similar


Thread

De-serializing an object with missing child classes "raphfrk@gmail.com" <raphfrk@gmail.com> - 2011-09-06 05:15 -0700
  Re: De-serializing an object with missing child classes Robert Klemme <shortcutter@googlemail.com> - 2011-09-06 05:34 -0700
    Re: De-serializing an object with missing child classes "raphfrk@gmail.com" <raphfrk@gmail.com> - 2011-09-06 07:17 -0700
      Re: De-serializing an object with missing child classes Robert Klemme <shortcutter@googlemail.com> - 2011-09-07 07:46 +0200
        Re: De-serializing an object with missing child classes Andreas Leitgeb <avl@gamma.logic.tuwien.ac.at> - 2011-09-07 11:45 +0000
          Re: De-serializing an object with missing child classes "raphfrk@gmail.com" <raphfrk@gmail.com> - 2011-09-07 07:17 -0700
        Re: De-serializing an object with missing child classes "raphfrk@gmail.com" <raphfrk@gmail.com> - 2011-09-07 07:14 -0700
  Re: De-serializing an object with missing child classes Roedy Green <see_website@mindprod.com.invalid> - 2011-09-06 06:04 -0700
  Re: De-serializing an object with missing child classes Roedy Green <see_website@mindprod.com.invalid> - 2011-09-06 11:59 -0700
    Re: De-serializing an object with missing child classes Arne Vajhøj <arne@vajhoej.dk> - 2011-09-06 19:51 -0400
      Re: De-serializing an object with missing child classes markspace <-@.> - 2011-09-06 17:53 -0700
  Re: De-serializing an object with missing child classes Arne Vajhøj <arne@vajhoej.dk> - 2011-09-06 19:53 -0400

csiph-web