Commit b4f5b380e801d9233f7caf5088b6525f3827a86d

Authored by Luis Pedro
1 parent e2e2c78267
Exists in master and in 1 other branch API_v3.0

C5078

src/main/java/org/um/dsi/gavea/orcid/client/configurator/JacksonConfigurator.java
@@ -0,0 +1,34 @@ @@ -0,0 +1,34 @@
  1 +/**
  2 + * Universidade do Minho
  3 + * Departamento de Sistemas de Informação
  4 + * Grupo Gávea
  5 + */
  6 +package org.um.dsi.gavea.orcid.client.configurator;
  7 +
  8 +import javax.ws.rs.ext.ContextResolver;
  9 +import javax.ws.rs.ext.Provider;
  10 +
  11 +import com.fasterxml.jackson.databind.DeserializationFeature;
  12 +import com.fasterxml.jackson.databind.ObjectMapper;
  13 +
  14 +/**
  15 +* @author Luís Pedro
  16 +*
  17 +* Created: 10 Oct 2018 - 15:27:59
  18 +*/
  19 +@Provider
  20 +public class JacksonConfigurator implements ContextResolver<ObjectMapper> {
  21 +
  22 + private final ObjectMapper mapper;
  23 +
  24 + public JacksonConfigurator() {
  25 + mapper = new ObjectMapper();
  26 + mapper.configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false);
  27 + }
  28 +
  29 + @Override
  30 + public ObjectMapper getContext(Class<?> type) {
  31 + return mapper;
  32 + }
  33 +
  34 +}
src/main/java/org/um/dsi/gavea/orcid/client/jackson/JacksonConfigurator.java
@@ -1,34 +0,0 @@ @@ -1,34 +0,0 @@
1 -/**  
2 - * Universidade do Minho  
3 - * Departamento de Sistemas de Informação  
4 - * Grupo Gávea  
5 - */  
6 -package org.um.dsi.gavea.orcid.client.jackson;  
7 -  
8 -import javax.ws.rs.ext.ContextResolver;  
9 -import javax.ws.rs.ext.Provider;  
10 -  
11 -import com.fasterxml.jackson.databind.DeserializationFeature;  
12 -import com.fasterxml.jackson.databind.ObjectMapper;  
13 -  
14 -/**  
15 -* @author Luís Pedro  
16 -*  
17 -* Created: 10 Oct 2018 - 15:27:59  
18 -*/  
19 -@Provider  
20 -public class JacksonConfigurator implements ContextResolver<ObjectMapper> {  
21 -  
22 - private final ObjectMapper mapper;  
23 -  
24 - public JacksonConfigurator() {  
25 - mapper = new ObjectMapper();  
26 - mapper.configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false);  
27 - }  
28 -  
29 - @Override  
30 - public ObjectMapper getContext(Class<?> type) {  
31 - return mapper;  
32 - }  
33 -  
34 -}