Revision 49580
Added by Sandro La Bruzzo over 6 years ago
DLIResolvedObjectFactory.java | ||
---|---|---|
1 | 1 |
package eu.dnetlib.dli.resolver; |
2 | 2 |
|
3 | 3 |
import com.google.gson.Gson; |
4 |
import com.google.gson.GsonBuilder; |
|
4 | 5 |
import eu.dnetlib.dli.resolver.model.DLIResolvedObject; |
6 |
import eu.dnetlib.dli.resolver.model.DLIResolvedObjectDeserializer; |
|
5 | 7 |
import eu.dnetlib.pid.resolver.model.ResolvedObject; |
6 | 8 |
import eu.dnetlib.pid.resolver.model.factory.ResolvedObjectFactory; |
7 | 9 |
|
8 | 10 |
public class DLIResolvedObjectFactory implements ResolvedObjectFactory { |
9 | 11 |
|
10 |
final private static Gson gson = new Gson(); |
|
12 |
final private static Gson gson = new GsonBuilder().registerTypeAdapter(DLIResolvedObject.class, new DLIResolvedObjectDeserializer()).create();
|
|
11 | 13 |
|
12 | 14 |
@Override |
13 | 15 |
public ResolvedObject generateObjectFromJson(String json) { |
14 |
return gson.fromJson(json, DLIResolvedObject.class);
|
|
16 |
return DLIResolvedObject.fromJson(json);
|
|
15 | 17 |
} |
16 | 18 |
} |
Also available in: Unified diff
Changed Crossref to use dump on mongoDB