9 Replies Latest reply on Nov 25, 2010 2:06 AM by 814681

    Externalising a class which includes reflection objects


      I'm writing some code which will externalize a message object.

      The message object, which implements Externalizable, contains another object as an instance variable. This inner object has, amongst others, an instance variable of type java.lang.reflect.Method.

      I can't get my head around what I'd need to do in the message object's writeExternal method in order to be able to read it back in again in the corresponding readExternal with respect to with the object of type Method.

      Previous uses of the Externalizable that I've coded have only used simple objects such as int primitives and Strings. Would I have to use ObjectOutput.writeObject and ObjectInput.readObject?

      Thanks in advance for any advice.