Details
-
Type: New Feature
-
Status: Closed
-
Priority: Minor
-
Resolution: Fixed
-
Affects Version/s: None
-
Fix Version/s: 1.3
-
Component/s: Converters
-
Labels:None
Description
It would be nice to be able to optionally allow transient fields to be deserialized. We'd like to use this as part of a deprecation/data migrations strategy.
If AbstractReflectionConverter had a method like:
protected boolean shouldDeserializeTransientField(){
return false
};
Then those of us who want this can trivially over-ride that in a customer ReflectionConverter
There are 2 places in AbstractReflectionConverter where the following code appears :
if (Modifier.isTransient(field.getModifiers()) {
reader.moveUp();
continue;
}
It could be easily modified to be
if (Modifier.isTransient(field.getModifiers() && !shouldDeserializeTransientField) {
reader.moveUp();
continue;
}
In this way, people could access this functionality with a trivial subclass of ReflectionConverter without any impact on current users or functionality.
Probably the "correct" way to do it is to put the query method in to the Mapper interface, but this would have more change/impact
Implemented as proposed. See head revision.