This week's book giveaway is in the Clojure forum.
We're giving away four copies of Clojure in Action and have Amit Rathore and Francis Avila on-line!
See this thread for details.
Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Making class fields non serializable using PropertyDescriptor

Slavko Perevalov
Posts: 5
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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:
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic