From d48f388c6afb234cf177d664996b18b2d154f5f4 Mon Sep 17 00:00:00 2001 From: Sam Brannen <104798+sbrannen@users.noreply.github.com> Date: Mon, 21 Oct 2024 12:19:35 +0200 Subject: [PATCH] =?UTF-8?q?Polish=20Javadoc=20for=20@=E2=81=A0DateTimeForm?= =?UTF-8?q?at?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../format/annotation/DateTimeFormat.java | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/spring-context/src/main/java/org/springframework/format/annotation/DateTimeFormat.java b/spring-context/src/main/java/org/springframework/format/annotation/DateTimeFormat.java index 435ad2b7ec..f8a63e64fe 100644 --- a/spring-context/src/main/java/org/springframework/format/annotation/DateTimeFormat.java +++ b/spring-context/src/main/java/org/springframework/format/annotation/DateTimeFormat.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2021 the original author or authors. + * Copyright 2002-2024 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -25,6 +25,9 @@ import java.lang.annotation.Target; /** * Declares that a field or method parameter should be formatted as a date or time. * + *

Formatting applies to parsing a date/time object from a string as well as printing a + * date/time object to a string. + * *

Supports formatting by style pattern, ISO date time pattern, or custom format pattern string. * Can be applied to {@link java.util.Date}, {@link java.util.Calendar}, {@link Long} (for * millisecond timestamps) as well as JSR-310 {@code java.time} value types. @@ -33,7 +36,8 @@ import java.lang.annotation.Target; * The first character of the code is the date style, and the second character is the time style. * Specify a character of 'S' for short style, 'M' for medium, 'L' for long, and 'F' for full. * The date or time may be omitted by specifying the style character '-' — for example, - * 'M-' specifies a medium format for the date with no time. + * 'M-' specifies a medium format for the date with no time. The supported style pattern codes + * correlate to the enum constants defined in {@link java.time.format.FormatStyle}. * *

For ISO-based formatting, set the {@link #iso} attribute to the desired {@link ISO} format, * such as {@link ISO#DATE}. @@ -65,6 +69,8 @@ import java.lang.annotation.Target; * @author Juergen Hoeller * @author Sam Brannen * @since 3.0 + * @see java.text.DateFormat + * @see java.text.SimpleDateFormat * @see java.time.format.DateTimeFormatter */ @Documented @@ -77,6 +83,8 @@ public @interface DateTimeFormat { *

Defaults to 'SS' for short date, short time. Set this attribute when you * wish to format your field or method parameter in accordance with a common * style other than the default style. + *

See the {@linkplain DateTimeFormat class-level documentation} for further + * details. * @see #fallbackPatterns */ String style() default "SS";