Skip to content

Commit ccb8e74

Browse files
committed
CronExpression javadoc improvement
1 parent fb0361b commit ccb8e74

File tree

1 file changed

+36
-4
lines changed

1 file changed

+36
-4
lines changed

spring-context/src/main/java/org/springframework/scheduling/support/CronExpression.java

Lines changed: 36 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -63,10 +63,42 @@ private CronExpression(
6363

6464

6565
/**
66-
* Parse the given expression string into a {@code CronExpression}.
67-
* The string has six single space-separated fields, representing
68-
* second, minute, hour, day, month, weekday. Month and weekday names can be
69-
* given as the first three letters of the English names.
66+
* Parse the given
67+
* <a href="https://www.manpagez.com/man/5/crontab/">crontab expression</a>
68+
* string into a {@code CronExpression}.
69+
* The string has six single space-separated time and date fields:
70+
* <pre>
71+
* &#9484;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472; second (0-59)
72+
* &#9474; &#9484;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472; minute (0 - 59)
73+
* &#9474; &#9474; &#9484;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472; hour (0 - 23)
74+
* &#9474; &#9474; &#9474; &#9484;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472; day of the month (1 - 31)
75+
* &#9474; &#9474; &#9474; &#9474; &#9484;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472; month (1 - 12) (or JAN-DEC)
76+
* &#9474; &#9474; &#9474; &#9474; &#9474; &#9484;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472; day of the week (0 - 7)
77+
* &#9474; &#9474; &#9474; &#9474; &#9474; &#9474; (0 or 7 is Sunday, or MON-SUN)
78+
* &#9474; &#9474; &#9474; &#9474; &#9474; &#9474;
79+
* &#42; &#42; &#42; &#42; &#42; &#42;
80+
* </pre>
81+
*
82+
* <p>The following rules apply:
83+
* <ul>
84+
* <li>
85+
* A field may be an asterisk ({@code *}), which always stands for
86+
* "first-last". For the "day of the month" or "day of the week" fields, a
87+
* question mark ({@code ?}) may be used instead of an asterisk.
88+
* </li>
89+
* <li>
90+
* Ranges of numbers are expressed by two numbers separated with a hyphen
91+
* ({@code -}). The specified range is inclusive.
92+
* </li>
93+
* <li>Following a range (or {@code *}) with {@code "/n"} specifies
94+
* skips of the number's value through the range.
95+
* </li>
96+
* <li>
97+
* English names can also be used for the "month" and "day of week" fields.
98+
* Use the first three letters of the particular day or month (case does not
99+
* matter).
100+
* </li>
101+
* </ul>
70102
*
71103
* <p>Example expressions:
72104
* <ul>

0 commit comments

Comments
 (0)