| | |
| | | import com.fasterxml.jackson.databind.JsonMappingException; |
| | | import com.fasterxml.jackson.databind.ObjectMapper; |
| | | import com.fasterxml.jackson.databind.ObjectWriter; |
| | | import com.fasterxml.jackson.datatype.jsr310.JavaTimeModule; |
| | | import org.springframework.stereotype.Component; |
| | | |
| | | import java.io.File; |
| | |
| | | */ |
| | | public static <T> T unmarshal(String str, Class<T> valueType) throws Exception { |
| | | try { |
| | | OBJECT_MAPPER.registerModule(new JavaTimeModule()); |
| | | return OBJECT_MAPPER.readValue(str, valueType); |
| | | } catch (JsonParseException e) { |
| | | throw new Exception(e); |