1 Reply Latest reply: Nov 18, 2010 3:37 AM by EJP RSS

    Serializing complex object

    723004
      Hi assuming the following class

      Class A implements Serializable{
      protected final Object value;

      public A( some args){
      }
      }

      And I have another class that would like to serialize class A.

      is it possible for me to change object A to be in some form of a wrapper perhaps? The actual code uses some other framework where I do not have access in changing.

      The problem is i would like to serialize a class but the class is very heavily nested and complex. Is there anyway for me to make the whole class serializable without digging down to every object and implementing the Serializable interface since some of the code are not changable?
        • 1. Re: Serializing complex object
          EJP
          You've been given a basically impossible problem to solve. If the value can be any arbitrary type you would basically have to write an infinite amount of code to handle all the possibilities. Instead the first thing you should do is move heaven and earth to get this class redesigned along more reasonable lines. Or not use Serialization.