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);
? format.getLocale() : serializers.getLocale(); SimpleDateFormat df = new SimpleDateFormat(format.getPattern(), loc); StdDateFormat std = (StdDateFormat) df0; if (format.hasLocale()) { std = std.withLocale(format.getLocale()); if (hasLocale) { df = new SimpleDateFormat(df.toPattern(), format.getLocale()); } else { df = (SimpleDateFormat) df.clone();
@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);
String pattern = format.getPattern(); if (pattern.length() > 0){ Locale loc = format.getLocale(); if (loc == null) { loc = prov.getLocale();
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 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);
Locale loc = format.getLocale(); if (loc == null) { loc = ctxt.getLocale();
Locale loc = format.getLocale(); if (loc == null) { loc = ctxt.getLocale();
: StdDateFormat.DATE_FORMAT_STR_ISO8601; final Locale loc = format.hasLocale() ? format.getLocale() : serializers.getLocale(); SimpleDateFormat df = new SimpleDateFormat(pattern, loc);
@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; } }
format = format.withLocale(ann.getLocale()); if (format != _format) { return new PeriodSerializer(format);
public JacksonJodaDateFormat with(JsonFormat.Value ann) { JacksonJodaDateFormat format = this; format = format.withLocale(ann.getLocale()); format = format.withTimeZone(ann.getTimeZone()); format = format.withFormat(ann.getPattern().trim()); Boolean adjustTZ = ann.getFeature(JsonFormat.Feature.ADJUST_DATES_TO_CONTEXT_TIME_ZONE); Boolean writeZoneId = ann.getFeature(JsonFormat.Feature.WRITE_DATES_WITH_ZONE_ID); if ((adjustTZ != _adjustToContextTZOverride) || (writeZoneId != _writeZoneId)) { format = new JacksonJodaDateFormat(format, adjustTZ, writeZoneId); } return format; }
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; }