-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
First fix for #622 that seems to work (after minor fixes to test also…
…; id class MUST implement #equals() and #hashCode()!) Will see if polymorphic case would support, and if not, what is needed to support it.
- Loading branch information
1 parent
e78d39d
commit d55cab3
Showing
5 changed files
with
162 additions
and
111 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -251,12 +251,24 @@ private final Object vanillaDeserialize(JsonParser p, | |
} | ||
|
||
/** | ||
* General version used when handling needs more advanced | ||
* features. | ||
* General version used when handling needs more advanced features. | ||
*/ | ||
@Override | ||
public Object deserializeFromObject(JsonParser p, DeserializationContext ctxt) throws IOException | ||
{ | ||
/* 09-Dec-2014, tatu: As per [#622], we need to allow Object Id references | ||
* to come in as JSON Objects as well; but for now assume they will | ||
* be simple, single-prooerty references, which means that we can | ||
This comment has been minimized.
Sorry, something went wrong.
This comment has been minimized.
Sorry, something went wrong.
cowtowncoder
Author
Member
|
||
* recognize them without having to buffer anything. | ||
* Once again, if we must, we can do more complex handling with buffering, | ||
* but let's only do that if and when that becomes necessary. | ||
*/ | ||
if (_objectIdReader != null && _objectIdReader.maySerializeAsObject()) { | ||
if (p.hasTokenId(JsonTokenId.ID_FIELD_NAME) | ||
&& _objectIdReader.isValidReferencePropertyName(p.getCurrentName(), p)) { | ||
return deserializeFromObjectId(p, ctxt); | ||
} | ||
} | ||
if (_nonStandardCreation) { | ||
if (_unwrappedPropertyHandler != null) { | ||
return deserializeWithUnwrapped(p, ctxt); | ||
|
@@ -276,14 +288,14 @@ public Object deserializeFromObject(JsonParser p, DeserializationContext ctxt) t | |
if (_needViewProcesing) { | ||
Class<?> view = ctxt.getActiveView(); | ||
if (view != null) { | ||
return deserializeWithView(jp, ctxt, bean, view); | ||
return deserializeWithView(p, ctxt, bean, view); | ||
} | ||
} | ||
*/ | ||
return bean; | ||
} | ||
final Object bean = _valueInstantiator.createUsingDefault(ctxt); | ||
// [databind#631]: Assign current value, to be accessible by custom serializers | ||
// [databind#631]: Assign current value, to be accessible by custom deserializers | ||
p.setCurrentValue(bean); | ||
if (p.canReadObjectId()) { | ||
Object id = p.getObjectId(); | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
prooerty. =)