package oncue.common.serializers; import java.text.SimpleDateFormat; import org.codehaus.jackson.map.DeserializationConfig; import org.codehaus.jackson.map.ObjectMapper; import org.codehaus.jackson.map.PropertyNamingStrategy; import org.codehaus.jackson.map.SerializationConfig; public class ObjectMapperFactory { private static final ObjectMapper mapper = new ObjectMapper(); static { mapper.setDateFormat(new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ssz")); mapper.configure(SerializationConfig.Feature.WRITE_ENUMS_USING_TO_STRING, true); mapper.configure(DeserializationConfig.Feature.READ_ENUMS_USING_TO_STRING, true); mapper.setPropertyNamingStrategy(PropertyNamingStrategy.CAMEL_CASE_TO_LOWER_CASE_WITH_UNDERSCORES); } private ObjectMapperFactory() { } public static ObjectMapper getInstance() { return mapper; } }