public BusinessObjectDeserializer() { mapper = new ObjectMapper(); mapper.configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false); final SimpleModule customModule = new SimpleModule(); customModule.addDeserializer(LocalDate.class, new CustomLocalDateDeserializer()); customModule.addDeserializer(LocalDateTime.class, new CustomLocalDateTimeDeserializer()); customModule.addDeserializer(OffsetDateTime.class, new CustomOffsetDateTimeDeserializer()); mapper.registerModule(customModule); typeFactory = mapper.getTypeFactory(); }
public BusinessObjectDeserializer() { mapper = new ObjectMapper(); mapper.configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false); final SimpleModule customModule = new SimpleModule(); customModule.addDeserializer(LocalDate.class, new CustomLocalDateDeserializer()); customModule.addDeserializer(LocalDateTime.class, new CustomLocalDateTimeDeserializer()); customModule.addDeserializer(OffsetDateTime.class, new CustomOffsetDateTimeDeserializer()); mapper.registerModule(customModule); typeFactory = mapper.getTypeFactory(); }
public BusinessDataObjectMapper() { objectMapper = new ObjectMapper(); // avoid to fail when serializing proxy (proxy will be recreated client side) see BS-16031 objectMapper.disable(SerializationFeature.FAIL_ON_EMPTY_BEANS); SimpleModule module = new SimpleModule(); module.addSerializer(LocalDate.class, new CustomLocalDateSerializer()); module.addSerializer(LocalDateTime.class, new CustomLocalDateTimeSerializer()); module.addSerializer(OffsetDateTime.class, new CustomOffsetDateTimeSerializer()); module.addDeserializer(LocalDate.class, new CustomLocalDateDeserializer()); module.addDeserializer(LocalDateTime.class, new CustomLocalDateTimeDeserializer()); module.addDeserializer(OffsetDateTime.class, new CustomOffsetDateTimeDeserializer()); objectMapper.registerModule(module); }
public BusinessDataObjectMapper() { objectMapper = new ObjectMapper(); // avoid to fail when serializing proxy (proxy will be recreated client side) see BS-16031 objectMapper.disable(SerializationFeature.FAIL_ON_EMPTY_BEANS); SimpleModule module = new SimpleModule(); module.addSerializer(LocalDate.class, new CustomLocalDateSerializer()); module.addSerializer(LocalDateTime.class, new CustomLocalDateTimeSerializer()); module.addSerializer(OffsetDateTime.class, new CustomOffsetDateTimeSerializer()); module.addDeserializer(LocalDate.class, new CustomLocalDateDeserializer()); module.addDeserializer(LocalDateTime.class, new CustomLocalDateTimeDeserializer()); module.addDeserializer(OffsetDateTime.class, new CustomOffsetDateTimeDeserializer()); objectMapper.registerModule(module); }