protected Object _unwrapAndDeserialize(JsonParser jp, JavaType rootType,
DeserializationContext ctxt, JsonDeserializer<Object> deser)
throws IOException, JsonParseException, JsonMappingException
{
SerializedString rootName = _deserializerProvider.findExpectedRootName(ctxt.getConfig(), rootType);
if (jp.getCurrentToken() != JsonToken.START_OBJECT) {
throw JsonMappingException.from(jp, "Current token not START_OBJECT (needed to unwrap root name '"
+rootName+"'), but "+jp.getCurrentToken());
}
if (jp.nextToken() != JsonToken.FIELD_NAME) {
throw JsonMappingException.from(jp, "Current token not FIELD_NAME (to contain expected root name '"
+rootName+"'), but "+jp.getCurrentToken());
}
String actualName = jp.getCurrentName();
if (!rootName.getValue().equals(actualName)) {
throw JsonMappingException.from(jp, "Root name '"+actualName+"' does not match expected ('"+rootName
+"') for type "+rootType);
}
// ok, then move to value itself....
jp.nextToken();