List of usage examples for com.fasterxml.jackson.datatype.joda JodaMapper JodaMapper
public JodaMapper()
From source file:DataTools.ConvertObjectToJson.java
public static <R> R convertToObject(String json, Class<R> type) { R mapped = null;/* www. jav a2s . c o m*/ JodaMapper mapper = new JodaMapper(); mapper.configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false) .configure(DeserializationFeature.READ_UNKNOWN_ENUM_VALUES_AS_NULL, true); try { mapped = mapper.readValue(json, type); } catch (IOException e) { e.printStackTrace(); } return mapped; }
From source file:org.yamj.api.trakttv.TraktTvApi.java
/** * Create the API/*from ww w . j ava 2s .c o m*/ * * @param clientId the client ID * @param clientSecret the client secret * @param httpClient the HTTP client to use for requesting web pages */ public TraktTvApi(final String clientId, final String clientSecret, final HttpClient httpClient) { this.clientId = clientId; this.clientSecret = clientSecret; this.httpClient = httpClient; JodaMapper jodaMapper = new JodaMapper(); jodaMapper.setWriteDatesAsTimestamps(false); this.objectMapper = jodaMapper; }