@@ -967,8 +967,7 @@ protected Object _handleTypedObjectId(JsonParser jp, DeserializationContext ctxt
967
967
*/
968
968
@ SuppressWarnings ("resource" ) // TokenBuffers don't need close, nor parser thereof
969
969
protected Object _convertObjectId (JsonParser jp , DeserializationContext ctxt ,
970
- Object rawId , JsonDeserializer <Object > idDeser )
971
- throws IOException , JsonProcessingException
970
+ Object rawId , JsonDeserializer <Object > idDeser ) throws IOException
972
971
{
973
972
TokenBuffer buf = new TokenBuffer (jp );
974
973
if (rawId instanceof String ) {
@@ -979,6 +978,8 @@ protected Object _convertObjectId(JsonParser jp, DeserializationContext ctxt,
979
978
buf .writeNumber (((Integer ) rawId ).intValue ());
980
979
} else {
981
980
// should we worry about UUIDs? They should be fine, right?
981
+ // 07-Aug-2014, tatu: Maybe, but not necessarily; had issues with
982
+ // Smile format; [Smile#19], possibly related.
982
983
buf .writeObject (rawId );
983
984
}
984
985
JsonParser bufParser = buf .asParser ();
@@ -1045,8 +1046,7 @@ protected Object deserializeWithObjectId(JsonParser jp, DeserializationContext c
1045
1046
* Method called in cases where it looks like we got an Object Id
1046
1047
* to parse and use as a reference.
1047
1048
*/
1048
- protected Object deserializeFromObjectId (JsonParser jp , DeserializationContext ctxt )
1049
- throws IOException , JsonProcessingException
1049
+ protected Object deserializeFromObjectId (JsonParser jp , DeserializationContext ctxt ) throws IOException
1050
1050
{
1051
1051
Object id = _objectIdReader .readObjectReference (jp , ctxt );
1052
1052
ReadableObjectId roid = ctxt .findObjectId (id , _objectIdReader .generator );
@@ -1060,8 +1060,7 @@ protected Object deserializeFromObjectId(JsonParser jp, DeserializationContext c
1060
1060
}
1061
1061
1062
1062
protected Object deserializeFromObjectUsingNonDefault (JsonParser jp ,
1063
- DeserializationContext ctxt )
1064
- throws IOException , JsonProcessingException
1063
+ DeserializationContext ctxt ) throws IOException
1065
1064
{
1066
1065
if (_delegateDeserializer != null ) {
1067
1066
return _valueInstantiator .createUsingDelegate (ctxt ,
@@ -1084,8 +1083,7 @@ protected abstract Object _deserializeUsingPropertyBased(final JsonParser jp,
1084
1083
throws IOException , JsonProcessingException ;
1085
1084
1086
1085
@ SuppressWarnings ("incomplete-switch" )
1087
- public Object deserializeFromNumber (JsonParser jp , DeserializationContext ctxt )
1088
- throws IOException , JsonProcessingException
1086
+ public Object deserializeFromNumber (JsonParser jp , DeserializationContext ctxt ) throws IOException
1089
1087
{
1090
1088
// First things first: id Object Id is used, most likely that's it
1091
1089
if (_objectIdReader != null ) {
@@ -1127,8 +1125,7 @@ public Object deserializeFromNumber(JsonParser jp, DeserializationContext ctxt)
1127
1125
throw ctxt .instantiationException (getBeanClass (), "no suitable creator method found to deserialize from JSON integer number" );
1128
1126
}
1129
1127
1130
- public Object deserializeFromString (JsonParser jp , DeserializationContext ctxt )
1131
- throws IOException , JsonProcessingException
1128
+ public Object deserializeFromString (JsonParser jp , DeserializationContext ctxt ) throws IOException
1132
1129
{
1133
1130
// First things first: id Object Id is used, most likely that's it
1134
1131
if (_objectIdReader != null ) {
@@ -1155,8 +1152,7 @@ public Object deserializeFromString(JsonParser jp, DeserializationContext ctxt)
1155
1152
* number.
1156
1153
*/
1157
1154
@ SuppressWarnings ("incomplete-switch" )
1158
- public Object deserializeFromDouble (JsonParser jp , DeserializationContext ctxt )
1159
- throws IOException , JsonProcessingException
1155
+ public Object deserializeFromDouble (JsonParser jp , DeserializationContext ctxt ) throws IOException
1160
1156
{
1161
1157
switch (jp .getNumberType ()) {
1162
1158
case FLOAT : // no separate methods for taking float...
@@ -1182,8 +1178,7 @@ public Object deserializeFromDouble(JsonParser jp, DeserializationContext ctxt)
1182
1178
/**
1183
1179
* Method called to deserialize POJO value from a JSON boolean value (true, false)
1184
1180
*/
1185
- public Object deserializeFromBoolean (JsonParser jp , DeserializationContext ctxt )
1186
- throws IOException , JsonProcessingException
1181
+ public Object deserializeFromBoolean (JsonParser jp , DeserializationContext ctxt ) throws IOException
1187
1182
{
1188
1183
if (_delegateDeserializer != null ) {
1189
1184
if (!_valueInstantiator .canCreateFromBoolean ()) {
@@ -1198,8 +1193,7 @@ public Object deserializeFromBoolean(JsonParser jp, DeserializationContext ctxt)
1198
1193
return _valueInstantiator .createFromBoolean (ctxt , value );
1199
1194
}
1200
1195
1201
- public Object deserializeFromArray (JsonParser jp , DeserializationContext ctxt )
1202
- throws IOException , JsonProcessingException
1196
+ public Object deserializeFromArray (JsonParser jp , DeserializationContext ctxt ) throws IOException
1203
1197
{
1204
1198
if (_delegateDeserializer != null ) {
1205
1199
try {
@@ -1214,6 +1208,19 @@ public Object deserializeFromArray(JsonParser jp, DeserializationContext ctxt)
1214
1208
}
1215
1209
throw ctxt .mappingException (getBeanClass ());
1216
1210
}
1211
+
1212
+ public Object deserializeFromEmbedded (JsonParser jp , DeserializationContext ctxt ) throws IOException
1213
+ {
1214
+ // First things first: id Object Id is used, most likely that's it; specifically,
1215
+ // true for UUIDs when written as binary (with Smile, other binary formats)
1216
+ if (_objectIdReader != null ) {
1217
+ return deserializeFromObjectId (jp , ctxt );
1218
+ }
1219
+
1220
+ // TODO: maybe add support for ValueInstantiator, embedded?
1221
+
1222
+ return jp .getEmbeddedObject ();
1223
+ }
1217
1224
1218
1225
/*
1219
1226
/**********************************************************
0 commit comments