public static ResponseDeserializer getResponseDeserializer ( String jsonStr ) throws JsonParseException , JsonMappingException , IOException { final ResponsePair p = mapper . readValue ( jsonStr , ResponsePair . class ) ; Response rr = null ; if ( p . getType ( ) != null ) { rr = ( Response ) mapper . readValue ( p . getResponse ( ) , p . getType ( ) ) ; } final Response resp = rr ; return new ResponseDeserializer ( ) { @ Override public ResponseHeader deserializerResponseHeader ( ) { return p . getResponseHeader ( ) ; } @ Override public Response deserializerResponse ( ) { return resp ; } } ; }
Deserialize the Response Json String .