@Override public Object deserializeTypedFromObject(JsonParser jp,DeserializationContext ctxt) throws IOException, JsonProcessingException {
  JsonToken t=jp.getCurrentToken();
  if (t == JsonToken.START_OBJECT) {
    t=jp.nextToken();
  }
 else   if (t == JsonToken.START_ARRAY) {
    return _deserializeTypedUsingDefaultImpl(jp,ctxt,null);
  }
 else   if (t != JsonToken.FIELD_NAME) {
    return _deserializeTypedUsingDefaultImpl(jp,ctxt,null);
  }
  TokenBuffer tb=null;
  for (; t == JsonToken.FIELD_NAME; t=jp.nextToken()) {
    String name=jp.getCurrentName();
    jp.nextToken();
    if (_typePropertyName.equals(name)) {
      String typeId=jp.getText();
      JsonDeserializer<Object> deser=_findDeserializer(ctxt,typeId);
      if (tb != null) {
        jp=JsonParserSequence.createFlattened(tb.asParser(jp),jp);
      }
      jp.nextToken();
      return deser.deserialize(jp,ctxt);
    }
    if (tb == null) {
      tb=new TokenBuffer(null);
    }
    tb.writeFieldName(name);
    tb.copyCurrentStructure(jp);
  }
  return _deserializeTypedUsingDefaultImpl(jp,ctxt,tb);
}

@ Override public Object deserializeTypedFromObject ( JsonParser jp , DeserializationContext ctxt ) throws IOException , JsonProcessingException { JsonToken t = jp . getCurrentToken ( ) ; if ( t == JsonToken . START_OBJECT ) { t = jp . nextToken ( ) ; } else if ( t == JsonToken . START_ARRAY ) { return _deserializeTypedUsingDefaultImpl ( jp , ctxt , null ) ; } else if ( t != JsonToken . FIELD_NAME ) { return _deserializeTypedUsingDefaultImpl ( jp , ctxt , null ) ; } TokenBuffer tb = null ; for ( ; t == JsonToken . FIELD_NAME ; t = jp . nextToken ( ) ) { String name = jp . getCurrentName ( ) ; jp . nextToken ( ) ; if ( _typePropertyName . equals ( name ) ) { String typeId = jp . getText ( ) ; JsonDeserializer < Object > deser = _findDeserializer ( ctxt , typeId ) ; if ( tb != null ) { jp = JsonParserSequence . createFlattened ( tb . asParser ( jp ) , jp ) ; } jp . nextToken ( ) ; return deser . deserialize ( jp , ctxt ) ; } if ( tb == null ) { tb = new TokenBuffer ( null ) ; } tb . writeFieldName ( name ) ; tb . copyCurrentStructure ( jp ) ; } return _deserializeTypedUsingDefaultImpl ( jp , ctxt , tb ) ; }
this is the trickiest thing to handle , since property we are looking for may be anywhere . . .
