Can Java's XMLEncoder serialize objects that have non-serializable fields?

I am really confused by all the opinions I find in books and even here so bear with me please!

It is stated in Clay Richardson's Professional Java JDK 6 that

you will notice that MyBean does not implement Serializable.

XMLEncoder/Decoder does not require classes it serializes to implement


and that

the XMLEncoder/Decoder API serializes object

instances without any knowledge of their private data members. It serializes based upon the object’s

methods, its JavaBean properties, exposed through the JavaBeans convention > of getters and setters (getXXX and setXXX).

Doesn't that mean that XMLEncoder can serialize non-serializable...

Read More »

By: StackOverFlow - Monday, 16 April

Related Posts