if (format.hasPattern()) { final String pattern = format.getPattern(); final Locale loc = format.hasLocale() ? format.getLocale() : ctxt.getLocale();
if (format.hasPattern()) { final Locale loc = format.hasLocale() ? format.getLocale()
@Override public JsonDeserializer<?> createContextual(DeserializationContext ctxt, BeanProperty property) throws JsonMappingException { if (property != null) { JsonFormat.Value format = ctxt.getAnnotationIntrospector().findFormat((Annotated) property.getMember()); if (format != null) { if (format.hasPattern()) { final String pattern = format.getPattern(); final Locale locale = format.hasLocale() ? format.getLocale() : ctxt.getLocale(); DateTimeFormatter df; if (locale == null) { df = DateTimeFormatter.ofPattern(pattern); } else { df = DateTimeFormatter.ofPattern(pattern, locale); } return withDateFormat(df); } // any use for TimeZone? } } return this; } }
if (format.hasPattern()) { final Locale loc = format.hasLocale() ? format.getLocale()
if (format.hasPattern()) { final String pattern = format.getPattern(); final Locale loc = format.hasLocale() ? format.getLocale() : ctxt.getLocale();
if (format.hasPattern()) { String pattern = format.getPattern(); final Locale loc = format.hasLocale() ? format.getLocale() : prov.getLocale();
if (format.hasPattern()) { String pattern = format.getPattern(); final Locale loc = format.hasLocale() ? format.getLocale() : prov.getLocale();
if (format.hasPattern()) { final String pattern = format.getPattern(); final Locale locale = format.hasLocale() ? format.getLocale() : prov.getLocale();
TimeZone tz = format.getTimeZone(); if (format.hasPattern()) { final String pattern = format.getPattern(); final Locale loc = format.hasLocale() ? format.getLocale() : ctxt.getLocale();
if (format.hasPattern()) { final String pattern = format.getPattern(); final Locale locale = format.hasLocale() ? format.getLocale() : prov.getLocale();
TimeZone tz = format.getTimeZone(); if (format.hasPattern()) { final String pattern = format.getPattern(); final Locale loc = format.hasLocale() ? format.getLocale() : ctxt.getLocale();
TimeZone tz = format.getTimeZone(); if (format.hasPattern()) { final String pattern = format.getPattern(); final Locale loc = format.hasLocale() ? format.getLocale() : ctxt.getLocale();
return withFormat(Boolean.TRUE, null); if ((shape == JsonFormat.Shape.STRING) || format.hasPattern() || format.hasLocale() || format.hasTimeZone()) { TimeZone tz = format.getTimeZone(); final String pattern = format.hasPattern() ? format.getPattern() : StdDateFormat.DATE_FORMAT_STR_ISO8601;
@Override public JsonDeserializer<?> createContextual(DeserializationContext ctxt, BeanProperty property) throws JsonMappingException { JsonFormat.Value format = findFormatOverrides(ctxt, property, handledType()); if (format != null) { if (format.hasPattern()) { final String pattern = format.getPattern(); final Locale locale = format.hasLocale() ? format.getLocale() : ctxt.getLocale(); DateTimeFormatter df; if (locale == null) { df = DateTimeFormatter.ofPattern(pattern); } else { df = DateTimeFormatter.ofPattern(pattern, locale); } //Issue #69: For instant serializers/deserializers we need to configure the formatter with //a time zone picked up from JsonFormat annotation, otherwise serialization might not work if (format.hasTimeZone()) { df = df.withZone(format.getTimeZone().toZoneId()); } return withDateFormat(df); } // any use for TimeZone? } return this; } }
@Override public JsonDeserializer<?> createContextual(DeserializationContext ctxt, BeanProperty property) throws JsonMappingException { JsonFormat.Value format = findFormatOverrides(ctxt, property, handledType()); if (format != null) { if (format.hasPattern()) { final String pattern = format.getPattern(); final Locale locale = format.hasLocale() ? format.getLocale() : ctxt.getLocale(); DateTimeFormatter df; if (locale == null) { df = DateTimeFormatter.ofPattern(pattern); } else { df = DateTimeFormatter.ofPattern(pattern, locale); } //Issue #69: For instant serializers/deserializers we need to configure the formatter with //a time zone picked up from JsonFormat annotation, otherwise serialization might not work if (format.hasTimeZone()) { df = df.withZone(DateTimeUtils.toZoneId(format.getTimeZone())); } return withDateFormat(df); } // any use for TimeZone? } return this; } }
@Override public JsonDeserializer<?> createContextual(DeserializationContext ctxt, BeanProperty property) throws JsonMappingException { if (property != null) { JsonFormat.Value format = ctxt.getAnnotationIntrospector().findFormat((Annotated) property.getMember()); if (format != null) { if (format.hasPattern()) { final String pattern = format.getPattern(); final Locale locale = format.hasLocale() ? format.getLocale() : ctxt.getLocale(); DateTimeFormatter df; if (locale == null) { df = DateTimeFormatter.ofPattern(pattern); } else { df = DateTimeFormatter.ofPattern(pattern, locale); } return withDateFormat(df); } // any use for TimeZone? } } return this; } }
if (format.hasPattern()) { final String pattern = format.getPattern(); final Locale locale = format.hasLocale() ? format.getLocale() : prov.getLocale();
@Override public JsonDeserializer<?> createContextual(DeserializationContext ctxt, BeanProperty property) throws JsonMappingException { JsonFormat.Value format = findFormatOverrides(ctxt, property, handledType()); if (format != null) { if (format.hasPattern()) { final String pattern = format.getPattern(); final Locale locale = format.hasLocale() ? format.getLocale() : ctxt.getLocale(); DateTimeFormatter df; if (locale == null) { df = DateTimeFormatter.ofPattern(pattern); } else { df = DateTimeFormatter.ofPattern(pattern, locale); } //Issue #69: For instant serializers/deserializers we need to configure the formatter with //a time zone picked up from JsonFormat annotation, otherwise serialization might not work if (format.hasTimeZone()) { df = df.withZone(format.getTimeZone().toZoneId()); } return withDateFormat(df); } // any use for TimeZone? } return this; }