Handling deserialization of enum values that no longer exist
问题 I have an enum JJJ that has 3 values: A, B, and C. In previous versions of my program it had one additional value: D. I'd like to be able to read in the serialized objects created by previous versions of the program, but an exception is thrown when it encounters a JJJ type variable with value 'D' in the serialized object. Optimally, I'd like to be able to intercept the deserialization process and tell it to just map D's to C's when it encounters them. According to http://docs.oracle.com