Reputation: 1194
I have a question regarding ObjectInputValidation
interface in java. This interface is used to validate graph after deserialization. My question is if one can validate the object in readObject
method, then why should we use ObjectInputValidation
?
Upvotes: 2
Views: 220
Reputation: 992
Serialization can save object graphs and with ObjectInputValidation you can check the state of the entire graph, which is done when all the graph is restored.
Upvotes: 1