This discussion is archived
9 Replies Latest reply: Nov 24, 2010 6:05 PM by EJP RSS

Externalising a class which includes reflection objects

814681 Newbie
Currently Being Moderated
Hello,

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.

Legend

  • Correct Answers - 10 points
  • Helpful Answers - 5 points