public synchronized < T > T fromJson ( String jsonString , Class < T > clazz ) throws JsonException { if ( jsonString == null ) { return null ; } Reader reader = new StringReader ( jsonString ) ; try { return mapper . readValue ( reader , clazz ) ; } catch ( JsonParseException e ) { throw new JsonException ( e . getMessage ( ) , e ) ; } catch ( JsonMappingException e ) { throw new JsonException ( e . getMessage ( ) , e ) ; } catch ( IOException e ) { throw new JsonException ( e . getMessage ( ) , e ) ; } }
Converts a given string into an object of the given class .