use of com.fasterxml.jackson.databind.ser.std.ToStringSerializer in project oc-explorer by devgateway.
the class MvcConfig method objectMapperBuilder.
@Bean
public Jackson2ObjectMapperBuilder objectMapperBuilder() {
Jackson2ObjectMapperBuilder builder = new Jackson2ObjectMapperBuilder();
// builder.featuresToEnable(DeserializationFeature.ACCEPT_SINGLE_VALUE_AS_ARRAY);
SimpleDateFormat dateFormatGmt = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss'Z'");
dateFormatGmt.setTimeZone(TimeZone.getTimeZone("GMT"));
builder.serializationInclusion(Include.NON_EMPTY).dateFormat(dateFormatGmt);
builder.serializerByType(GeoJsonPoint.class, new GeoJsonPointSerializer());
builder.serializerByType(ObjectId.class, new ToStringSerializer());
builder.defaultViewInclusion(true);
return builder;
}
use of com.fasterxml.jackson.databind.ser.std.ToStringSerializer in project ocvn by devgateway.
the class MvcConfig method objectMapperBuilder.
@Bean
public Jackson2ObjectMapperBuilder objectMapperBuilder() {
Jackson2ObjectMapperBuilder builder = new Jackson2ObjectMapperBuilder();
//builder.featuresToEnable(DeserializationFeature.ACCEPT_SINGLE_VALUE_AS_ARRAY);
SimpleDateFormat dateFormatGmt = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss'Z'");
dateFormatGmt.setTimeZone(TimeZone.getTimeZone("GMT"));
builder.serializationInclusion(Include.NON_EMPTY).dateFormat(dateFormatGmt);
builder.serializerByType(GeoJsonPoint.class, new GeoJsonPointSerializer());
builder.serializerByType(ObjectId.class, new ToStringSerializer());
builder.defaultViewInclusion(true);
return builder;
}
Aggregations