本文整理汇总了Java中com.fasterxml.jackson.databind.SerializationFeature.WRITE_DATES_AS_TIMESTAMPS属性的典型用法代码示例。如果您正苦于以下问题:Java SerializationFeature.WRITE_DATES_AS_TIMESTAMPS属性的具体用法?Java SerializationFeature.WRITE_DATES_AS_TIMESTAMPS怎么用?Java SerializationFeature.WRITE_DATES_AS_TIMESTAMPS使用的例子?那么恭喜您, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在类com.fasterxml.jackson.databind.SerializationFeature
的用法示例。
在下文中一共展示了SerializationFeature.WRITE_DATES_AS_TIMESTAMPS属性的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: JsonMapper
public JsonMapper() {
// calls the default constructor
super();
// configures ISO8601 formatter for date without time zone
// the used format is 'yyyy-MM-dd'
super.setDateFormat(new SimpleDateFormat(FMT_ISO_LOCAL_DATE));
// enforces to skip null and empty values in the serialized JSON output
super.setSerializationInclusion(JsonInclude.Include.NON_EMPTY);
// enforces to skip null references in the serialized output of Map
super.configure(SerializationFeature.WRITE_NULL_MAP_VALUES, false);
// enables serialization failures, when mapper encounters unknown properties names
super.configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, true);
// configures the format to prevent writing of the serialized output for java.util.Date
// instances as timestamps. any date should be written in ISO format
super.configure(SerializationFeature.WRITE_DATES_AS_TIMESTAMPS, false);
}