9 Replies Latest reply: Nov 24, 2010 8:06 PM by 814681 RSS

    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.