Code example for StringReader

0
 
    @Override 
    public T unmarshall(Class<T> clazz, String obj) {
        try { 
            JsonFactory jsonFactory = new MappingJsonFactory();
            JsonParser jsonParser = jsonFactory.createJsonParser(new StringReader(obj));
            return jsonParser.readValueAs(clazz);
        } catch ( Exception e ) {
            throw new RuntimeException(e);
        } 
    } 
 
}