wood burning stoves*
The moose likes Java in General and the fly likes Making class fields non serializable using PropertyDescriptor Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Java » Java in General
Bookmark "Making class fields non serializable using PropertyDescriptor" Watch "Making class fields non serializable using PropertyDescriptor" New topic
Author

Making class fields non serializable using PropertyDescriptor

Slavko Perevalov
Greenhorn

Joined: Dec 29, 2008
Posts: 5
Hello to all readers of this topic!


Suppose I have a class A with set of fields and method that makes em non-serializable:



And class B that extends class A and has static initializer that calls A.makePropertiesTransient :


Now comes the question When I create new instance of B method call makePropertiesTransient(B.class) is executed so all inherited fields in B become transient. But I found that for superclass (i.e. class A) they are also become transient so serialization process for instance of class A skips all fields too.
Could you suggest how to avoid propagation of transient properties to superclass, so instances of class A would be serialized completely, but instances of class B not ?
Thank you!
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Making class fields non serializable using PropertyDescriptor
 
Similar Threads
Fill bean data from HashMap using Reflection
merging data values of two similar objects
regarding Serializable
Can transient variables be static??
Serializable interface.