|
1 | 1 | /*
|
2 |
| - * Copyright 2002-2021 the original author or authors. |
| 2 | + * Copyright 2002-2024 the original author or authors. |
3 | 3 | *
|
4 | 4 | * Licensed under the Apache License, Version 2.0 (the "License");
|
5 | 5 | * you may not use this file except in compliance with the License.
|
|
25 | 25 | /**
|
26 | 26 | * Declares that a field or method parameter should be formatted as a date or time.
|
27 | 27 | *
|
| 28 | + * <p>Formatting applies to parsing a date/time object from a string as well as printing a |
| 29 | + * date/time object to a string. |
| 30 | + * |
28 | 31 | * <p>Supports formatting by style pattern, ISO date time pattern, or custom format pattern string.
|
29 | 32 | * Can be applied to {@link java.util.Date}, {@link java.util.Calendar}, {@link Long} (for
|
30 | 33 | * millisecond timestamps) as well as JSR-310 {@code java.time} value types.
|
|
33 | 36 | * The first character of the code is the date style, and the second character is the time style.
|
34 | 37 | * Specify a character of 'S' for short style, 'M' for medium, 'L' for long, and 'F' for full.
|
35 | 38 | * The date or time may be omitted by specifying the style character '-' — for example,
|
36 |
| - * 'M-' specifies a medium format for the date with no time. |
| 39 | + * 'M-' specifies a medium format for the date with no time. The supported style pattern codes |
| 40 | + * correlate to the enum constants defined in {@link java.time.format.FormatStyle}. |
37 | 41 | *
|
38 | 42 | * <p>For ISO-based formatting, set the {@link #iso} attribute to the desired {@link ISO} format,
|
39 | 43 | * such as {@link ISO#DATE}.
|
|
65 | 69 | * @author Juergen Hoeller
|
66 | 70 | * @author Sam Brannen
|
67 | 71 | * @since 3.0
|
| 72 | + * @see java.text.DateFormat |
| 73 | + * @see java.text.SimpleDateFormat |
68 | 74 | * @see java.time.format.DateTimeFormatter
|
69 | 75 | */
|
70 | 76 | @Documented
|
|
77 | 83 | * <p>Defaults to 'SS' for short date, short time. Set this attribute when you
|
78 | 84 | * wish to format your field or method parameter in accordance with a common
|
79 | 85 | * style other than the default style.
|
| 86 | + * <p>See the {@linkplain DateTimeFormat class-level documentation} for further |
| 87 | + * details. |
80 | 88 | * @see #fallbackPatterns
|
81 | 89 | */
|
82 | 90 | String style() default "SS";
|
|
0 commit comments