Deprecate Joda time support
This commit deprecates the Joda time support and schedules it for removal in 6.0. Closes gh-25736
This commit is contained in:
@@ -42,7 +42,9 @@ import org.springframework.util.StringUtils;
|
||||
* @see #setStyle
|
||||
* @see #setIso
|
||||
* @see DateTimeFormatterFactoryBean
|
||||
* @deprecated as of 5.3.0, scheduled for removal in 6.0.
|
||||
*/
|
||||
@Deprecated
|
||||
public class DateTimeFormatterFactory {
|
||||
|
||||
@Nullable
|
||||
|
||||
@@ -33,7 +33,9 @@ import org.springframework.lang.Nullable;
|
||||
* @see #setIso
|
||||
* @see #setStyle
|
||||
* @see DateTimeFormatterFactory
|
||||
* @deprecated as of 5.3.0, scheduled for removal in 6.0.
|
||||
*/
|
||||
@Deprecated
|
||||
public class DateTimeFormatterFactoryBean extends DateTimeFormatterFactory
|
||||
implements FactoryBean<DateTimeFormatter>, InitializingBean {
|
||||
|
||||
|
||||
@@ -29,7 +29,9 @@ import org.springframework.format.Parser;
|
||||
*
|
||||
* @author Keith Donald
|
||||
* @since 3.0
|
||||
* @deprecated as of 5.3.0, scheduled for removal in 6.0.
|
||||
*/
|
||||
@Deprecated
|
||||
public final class DateTimeParser implements Parser<DateTime> {
|
||||
|
||||
private final DateTimeFormatter formatter;
|
||||
|
||||
@@ -45,7 +45,9 @@ import org.springframework.util.StringUtils;
|
||||
* @author Juergen Hoeller
|
||||
* @since 3.0
|
||||
* @see DateTimeFormat
|
||||
* @deprecated as of 5.3.0, scheduled for removal in 6.0.
|
||||
*/
|
||||
@Deprecated
|
||||
public class JodaDateTimeFormatAnnotationFormatterFactory extends EmbeddedValueResolutionSupport
|
||||
implements AnnotationFormatterFactory<DateTimeFormat> {
|
||||
|
||||
|
||||
@@ -36,7 +36,9 @@ import org.springframework.lang.Nullable;
|
||||
* @author Keith Donald
|
||||
* @since 3.0
|
||||
* @see JodaTimeContextHolder
|
||||
* @deprecated as of 5.3.0, scheduled for removal in 6.0.
|
||||
*/
|
||||
@Deprecated
|
||||
public class JodaTimeContext {
|
||||
|
||||
@Nullable
|
||||
|
||||
@@ -31,7 +31,9 @@ import org.springframework.lang.Nullable;
|
||||
* @author Juergen Hoeller
|
||||
* @since 3.0
|
||||
* @see org.springframework.context.i18n.LocaleContextHolder
|
||||
* @deprecated as of 5.3.0, scheduled for removal in 6.0.
|
||||
*/
|
||||
@Deprecated
|
||||
public final class JodaTimeContextHolder {
|
||||
|
||||
private static final ThreadLocal<JodaTimeContext> jodaTimeContextHolder =
|
||||
|
||||
@@ -55,7 +55,9 @@ import org.springframework.format.annotation.DateTimeFormat.ISO;
|
||||
* @see FormatterRegistrar#registerFormatters
|
||||
* @see org.springframework.format.datetime.DateFormatterRegistrar
|
||||
* @see DateTimeFormatterFactoryBean
|
||||
* @deprecated as of 5.3.0, scheduled for removal in 6.0.
|
||||
*/
|
||||
@Deprecated
|
||||
public class JodaTimeFormatterRegistrar implements FormatterRegistrar {
|
||||
|
||||
private enum Type {DATE, TIME, DATE_TIME}
|
||||
|
||||
@@ -30,7 +30,9 @@ import org.springframework.format.Parser;
|
||||
*
|
||||
* @author Juergen Hoeller
|
||||
* @since 4.0
|
||||
* @deprecated as of 5.3.0, scheduled for removal in 6.0.
|
||||
*/
|
||||
@Deprecated
|
||||
public final class LocalDateParser implements Parser<LocalDate> {
|
||||
|
||||
private final DateTimeFormatter formatter;
|
||||
|
||||
@@ -30,7 +30,9 @@ import org.springframework.format.Parser;
|
||||
*
|
||||
* @author Juergen Hoeller
|
||||
* @since 4.0
|
||||
* @deprecated as of 5.3.0, scheduled for removal in 6.0.
|
||||
*/
|
||||
@Deprecated
|
||||
public final class LocalDateTimeParser implements Parser<LocalDateTime> {
|
||||
|
||||
private final DateTimeFormatter formatter;
|
||||
|
||||
@@ -30,7 +30,9 @@ import org.springframework.format.Parser;
|
||||
*
|
||||
* @author Juergen Hoeller
|
||||
* @since 4.0
|
||||
* @deprecated as of 5.3.0, scheduled for removal in 6.0.
|
||||
*/
|
||||
@Deprecated
|
||||
public final class LocalTimeParser implements Parser<LocalTime> {
|
||||
|
||||
private final DateTimeFormatter formatter;
|
||||
|
||||
@@ -27,7 +27,9 @@ import org.springframework.format.Printer;
|
||||
*
|
||||
* @author Keith Donald
|
||||
* @since 3.0
|
||||
* @deprecated as of 5.3.0, scheduled for removal in 6.0.
|
||||
*/
|
||||
@Deprecated
|
||||
public final class MillisecondInstantPrinter implements Printer<Long> {
|
||||
|
||||
private final DateTimeFormatter formatter;
|
||||
|
||||
@@ -28,7 +28,9 @@ import org.springframework.format.Printer;
|
||||
*
|
||||
* @author Keith Donald
|
||||
* @since 3.0
|
||||
* @deprecated as of 5.3.0, scheduled for removal in 6.0.
|
||||
*/
|
||||
@Deprecated
|
||||
public final class ReadableInstantPrinter implements Printer<ReadableInstant> {
|
||||
|
||||
private final DateTimeFormatter formatter;
|
||||
|
||||
@@ -28,7 +28,9 @@ import org.springframework.format.Printer;
|
||||
*
|
||||
* @author Keith Donald
|
||||
* @since 3.0
|
||||
* @deprecated as of 5.3.0, scheduled for removal in 6.0.
|
||||
*/
|
||||
@Deprecated
|
||||
public final class ReadablePartialPrinter implements Printer<ReadablePartial> {
|
||||
|
||||
private final DateTimeFormatter formatter;
|
||||
|
||||
@@ -19,7 +19,6 @@ package org.springframework.format.support;
|
||||
import org.springframework.core.convert.support.DefaultConversionService;
|
||||
import org.springframework.format.FormatterRegistry;
|
||||
import org.springframework.format.datetime.DateFormatterRegistrar;
|
||||
import org.springframework.format.datetime.joda.JodaTimeFormatterRegistrar;
|
||||
import org.springframework.format.datetime.standard.DateTimeFormatterRegistrar;
|
||||
import org.springframework.format.number.NumberFormatAnnotationFormatterFactory;
|
||||
import org.springframework.format.number.money.CurrencyUnitFormatter;
|
||||
@@ -57,7 +56,6 @@ public class DefaultFormattingConversionService extends FormattingConversionServ
|
||||
jodaTimePresent = ClassUtils.isPresent("org.joda.time.YearMonth", classLoader);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Create a new {@code DefaultFormattingConversionService} with the set of
|
||||
* {@linkplain DefaultConversionService#addDefaultConverters default converters} and
|
||||
@@ -106,6 +104,7 @@ public class DefaultFormattingConversionService extends FormattingConversionServ
|
||||
* depending on the presence of the corresponding API on the classpath.
|
||||
* @param formatterRegistry the service to register default formatters with
|
||||
*/
|
||||
@SuppressWarnings("deprecation")
|
||||
public static void addDefaultFormatters(FormatterRegistry formatterRegistry) {
|
||||
// Default handling of number values
|
||||
formatterRegistry.addFormatterForFieldAnnotation(new NumberFormatAnnotationFormatterFactory());
|
||||
@@ -124,7 +123,7 @@ public class DefaultFormattingConversionService extends FormattingConversionServ
|
||||
|
||||
if (jodaTimePresent) {
|
||||
// handles Joda-specific types as well as Date, Calendar, Long
|
||||
new JodaTimeFormatterRegistrar().registerFormatters(formatterRegistry);
|
||||
new org.springframework.format.datetime.joda.JodaTimeFormatterRegistrar().registerFormatters(formatterRegistry);
|
||||
}
|
||||
else {
|
||||
// regular DateFormat-based Date, Calendar, Long converters
|
||||
|
||||
Reference in New Issue
Block a user