final Locale loc = format.hasLocale() ? format.getLocale() : ctxt.getLocale(); SimpleDateFormat df = new SimpleDateFormat(pattern, loc); if (tz == null) { final Locale loc = format.hasLocale() ? format.getLocale() : ctxt.getLocale(); StdDateFormat std = (StdDateFormat) df; std = std.withTimeZone(tz);
final Locale loc = format.hasLocale() ? format.getLocale() : serializers.getLocale(); final boolean hasLocale = format.hasLocale(); final boolean hasTZ = format.hasTimeZone(); final boolean asString = (shape == JsonFormat.Shape.STRING); if (format.hasLocale()) { std = std.withLocale(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; } }
final Locale loc = format.hasLocale() ? format.getLocale() : serializers.getLocale(); final boolean hasLocale = format.hasLocale(); final boolean hasTZ = format.hasTimeZone(); final boolean asString = (shape == JsonFormat.Shape.STRING); if (format.hasLocale()) { std = std.withLocale(format.getLocale());
final Locale loc = format.hasLocale() ? format.getLocale() : ctxt.getLocale(); SimpleDateFormat df = new SimpleDateFormat(pattern, loc); if (tz == null) { final Locale loc = format.hasLocale() ? format.getLocale() : ctxt.getLocale(); StdDateFormat std = (StdDateFormat) df; std = std.withTimeZone(tz);
if (format.hasPattern()) { String pattern = format.getPattern(); final Locale loc = format.hasLocale() ? format.getLocale() : prov.getLocale(); SimpleDateFormat df = new SimpleDateFormat(pattern, loc); if (tz == null) { final Locale loc = format.hasLocale() ? format.getLocale() : prov.getLocale(); df = StdDateFormat.getISO8601Format(tz, loc); } else {
if (format.hasPattern()) { String pattern = format.getPattern(); final Locale loc = format.hasLocale() ? format.getLocale() : prov.getLocale(); SimpleDateFormat df = new SimpleDateFormat(pattern, loc); if (tz == null) { final Locale loc = format.hasLocale() ? format.getLocale() : prov.getLocale(); df = StdDateFormat.getISO8601Format(tz, loc); } else {
final Locale locale = format.hasLocale() ? format.getLocale() : prov.getLocale(); if (locale == null) { dtf = DateTimeFormatter.ofPattern(pattern);
final Locale loc = format.hasLocale() ? format.getLocale() : ctxt.getLocale(); SimpleDateFormat df = new SimpleDateFormat(pattern, loc); if (tz == null) { final Locale loc = format.hasLocale() ? format.getLocale() : ctxt.getLocale(); StdDateFormat std = (StdDateFormat) df; std = std.withTimeZone(tz);
final Locale locale = format.hasLocale() ? format.getLocale() : prov.getLocale(); if (locale == null) { dtf = DateTimeFormatter.ofPattern(pattern);
final Locale loc = format.hasLocale() ? format.getLocale() : ctxt.getLocale(); SimpleDateFormat df = new SimpleDateFormat(pattern, loc); if (tz == null) { final Locale loc = format.hasLocale() ? format.getLocale() : ctxt.getLocale(); StdDateFormat std = (StdDateFormat) df; std = std.withTimeZone(tz);
final Locale loc = format.hasLocale() ? format.getLocale() : ctxt.getLocale(); SimpleDateFormat df = new SimpleDateFormat(pattern, loc); if (tz == null) { final Locale loc = format.hasLocale() ? format.getLocale() : ctxt.getLocale(); StdDateFormat std = (StdDateFormat) df; std = std.withTimeZone(tz);
@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; } }
final Locale locale = format.hasLocale() ? format.getLocale() : prov.getLocale(); if (locale == null) { dtf = DateTimeFormatter.ofPattern(pattern);
@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; }