com.shopify.mappers.ShopifySdkObjectMapper Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of shopify-sdk Show documentation
Show all versions of shopify-sdk Show documentation
Java SDK for Shopify REST API.
package com.shopify.mappers;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.databind.AnnotationIntrospector;
import com.fasterxml.jackson.databind.DeserializationFeature;
import com.fasterxml.jackson.databind.MapperFeature;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.fasterxml.jackson.databind.introspect.JacksonAnnotationIntrospector;
import com.fasterxml.jackson.databind.type.TypeFactory;
import com.fasterxml.jackson.module.jaxb.JaxbAnnotationIntrospector;
public class ShopifySdkObjectMapper {
private ShopifySdkObjectMapper() {
}
public static ObjectMapper buildMapper() {
final ObjectMapper mapper = new ObjectMapper();
mapper.configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false);
mapper.setSerializationInclusion(JsonInclude.Include.NON_NULL);
final AnnotationIntrospector pair = AnnotationIntrospector.pair(
new JaxbAnnotationIntrospector(TypeFactory.defaultInstance()), new JacksonAnnotationIntrospector());
mapper.setAnnotationIntrospector(pair);
mapper.enable(MapperFeature.USE_ANNOTATIONS);
return mapper;
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy