use of com.fasterxml.jackson.datatype.jsr310.JavaTimeModule in project alf.io by alfio-event.
the class MvcConfiguration method objectMapper.
@Bean
public ObjectMapper objectMapper() {
ObjectMapper mapper = new ObjectMapper();
mapper.registerModule(new JavaTimeModule());
mapper.configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false);
mapper.configure(SerializationFeature.WRITE_DATES_AS_TIMESTAMPS, false);
return mapper;
}
use of com.fasterxml.jackson.datatype.jsr310.JavaTimeModule in project vft-capture by videofirst.
the class FileSystemCaptureDaoTest method setUp.
@Before
public void setUp() throws IOException {
// clean out any videos generated
VftTesting.initTestFolders();
objectMapper = new ObjectMapper();
objectMapper.registerModule(new JavaTimeModule());
objectMapper.disable(WRITE_DATES_AS_TIMESTAMPS);
target = new FileSystemCaptureDao(objectMapper, VftTesting.VFT_VIDEO_FOLDER);
}
use of com.fasterxml.jackson.datatype.jsr310.JavaTimeModule in project nixmash-blog by mintster.
the class WebConfig method configureMessageConverters.
// endregion
// region Messages
@Override
public void configureMessageConverters(List<HttpMessageConverter<?>> converters) {
final MappingJackson2HttpMessageConverter converter = new MappingJackson2HttpMessageConverter();
final ObjectMapper objectMapper = new ObjectMapper();
objectMapper.configure(SerializationFeature.INDENT_OUTPUT, true);
objectMapper.disable(SerializationFeature.WRITE_DATES_AS_TIMESTAMPS);
objectMapper.setSerializationInclusion(JsonInclude.Include.NON_NULL);
objectMapper.registerModule(new JavaTimeModule());
converter.setObjectMapper(objectMapper);
converters.add(converter);
super.configureMessageConverters(converters);
}
use of com.fasterxml.jackson.datatype.jsr310.JavaTimeModule in project minijax by minijax.
the class Json method getObjectMapper.
public static ObjectMapper getObjectMapper() {
if (instance == null) {
instance = new ObjectMapper();
instance.disable(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES);
instance.setSerializationInclusion(Include.NON_NULL);
instance.registerModule(new JaxbAnnotationModule());
instance.registerModule(new JavaTimeModule());
instance.disable(SerializationFeature.WRITE_DATES_AS_TIMESTAMPS);
instance.registerModule(new AfterburnerModule());
}
return instance;
}
use of com.fasterxml.jackson.datatype.jsr310.JavaTimeModule in project SONG by overture-stack.
the class JsonDocUtils method getJsonNodeFromClasspath.
@SneakyThrows
public static JsonNode getJsonNodeFromClasspath(String fileName) {
ObjectMapper mapper = new ObjectMapper().registerModule(new ParameterNamesModule()).registerModule(new Jdk8Module()).registerModule(new JavaTimeModule());
InputStream is = Thread.currentThread().getContextClassLoader().getResourceAsStream(fileName);
JsonNode actualObj = mapper.readTree(is);
return actualObj;
}
Aggregations