public enum PatternType extends java.lang.Enum<PatternType> implements ChronoPattern<PatternType>
Collection of different format patterns.
| Enum Constant and Description |
|---|
CLDR
This standard pattern is applicable on all ISO-chronologies and follows the standard
LDML of unicode-consortium.
|
CLDR_24
CLDR-variant with the only difference how the symbol "H" will be interpreted.
|
NON_ISO_DATE
A small subset of CLDR applicable on any non-ISO-chronology which has registered the
associated elements with same symbols.
|
SIMPLE_DATE_FORMAT
Follows the format pattern description of class
SimpleDateFormat, which is very near, but not
exactly the same as CLDR. |
| Modifier and Type | Method and Description |
|---|---|
FormatEngine<PatternType> |
getFormatEngine()
Yields the format engine this pattern is designed for.
|
static PatternType |
valueOf(java.lang.String name)
Returns the enum constant of this type with the specified name.
|
static PatternType[] |
values()
Returns an array containing the constants of this enum type, in
the order they are declared.
|
public static final PatternType CLDR
This standard pattern is applicable on all ISO-chronologies and follows the standard LDML of unicode-consortium.
If not explicitly stated otherwise the count of symbols always controls the minimum count of digits in case of a numerical element. Is an element shorter then the zero digit will be used for padding.
| Element | Symbol | Description |
|---|---|---|
ERA |
G | One to three symbols indicate an abbreviation, four symbols indicate the long form and five symbols stand for a letter. The era is based on the chronological history of the current format locale. |
YEAR_OF_ERA |
y | The count of symbols normally controls the minimum count of
digits. If it is 2 however then the year will be printed with
exact two digits using the attribute Attributes.PIVOT_YEAR.
Important: If the era is not present then this symbol will simply
be mapped to PlainDate.YEAR. |
PlainDate.YEAR_OF_WEEKDATE |
Y | Represents the year in an ISO-8601 week date and behaves like the calendar year in formatting. The week-based year can deviate from the calendar year however because it is bound to the week cycle. |
PlainDate.YEAR |
u | Proleptic ISO-8601 calendar year. This year never uses a pivot year, also not for "uu". A positive sign will be used exactly if the year has more digits than given by count of symbols. In contrast to the symbol y, this year can never be the historized year-of-era. |
PlainDate.QUARTER_OF_YEAR |
Q | One or two symbols for the numerical form, three symbols for the abbreviation, four for the full name and five for a letter symbol (NARROW). |
PlainDate.QUARTER_OF_YEAR |
q | Like Q, but in the version OutputContext.STANDALONE.
In some languages (not english) the stand-alone-version requires
a special grammar. |
| MONTH_OF_YEAR | M | One or two symbols for the numerical form, three symbols
for the abbreviation, four for the full name and five for
a letter symbol (NARROW). Important: If the era is not present
then this symbol will simply be mapped to PlainDate.MONTH_OF_YEAR. |
| MONTH_OF_YEAR | L | Like M, but in the version OutputContext.STANDALONE.
In some languages (not english) the stand-alone-version requires
a special grammar. |
Weekmodel.weekOfYear() |
w | One or two symbols for the country-dependent week of year. |
Weekmodel.weekOfMonth() |
W | One symbol for the country-dependent week of month. |
| DAY_OF_MONTH | d | One or two symbols for the day of month. Important: If the era is not present
then this symbol will simply be mapped to PlainDate.DAY_OF_MONTH. |
PlainDate.DAY_OF_YEAR |
D | One, two or three symbols for the day of year. |
PlainDate.WEEKDAY_IN_MONTH |
F | One symbol for the weekday in month. |
EpochDays.MODIFIED_JULIAN_DATE |
g | The count of symbols usually controls the minimum count of
digits of modified julian year, that is the count of days relative
to 1858-11-17. Is only supported by calendrical types like
PlainDate. |
PlainDate.DAY_OF_WEEK |
E | One to three symbols for the abbreviation, four for the full name, five for a letter symbol or six for the short form. |
Weekmodel.localDayOfWeek() |
e | Like E, but if there are only one or two symbols then the formatter will choose the localized numerical form. |
Weekmodel.localDayOfWeek() |
c | Like e, but in the version OutputContext.STANDALONE.
In some languages (not english) the stand-alone-version requires
a special grammar. However, 2 symbols are not allowed. |
PlainTime.AM_PM_OF_DAY |
a | One symbol for the text form. The attribute
Attributes.TEXT_WIDTH can have impact on the length
of the text form however. |
PlainTime.CLOCK_HOUR_OF_AMPM |
h | One or two symbols for the numerical form. |
PlainTime.DIGITAL_HOUR_OF_DAY |
H | One or two symbols for the numerical form. |
PlainTime.DIGITAL_HOUR_OF_AMPM |
K | One or two symbols for the numerical form. |
PlainTime.CLOCK_HOUR_OF_DAY |
k | One or two symbols for the numerical form. |
PlainTime.MINUTE_OF_HOUR |
m | One or two symbols for the numerical form. |
PlainTime.SECOND_OF_MINUTE |
s | One or two symbols for the numerical form. |
PlainTime.NANO_OF_SECOND |
S | The count of symbols (1-9) controls the minimum and maximum count of digits to be printed. The decimal separation char will not be printed. |
PlainTime.MILLI_OF_DAY |
A | The count of symbols (1-9) controls the minimum count of digits to be printed. |
| TIMEZONE_NAME | z | 1-3 symbols for the abbreviation, 4 symbols for the full timezone name. |
| TIMEZONE_OFFSET | Z | 1-3 symbols => see xxxx, 4 symbols => see OOOO, 5 symbols = > see XXXXX. |
| LOCALIZED_GMT_OFFSET | O | One symbol for the abbreviation or 4 symbols for the long variant. The GMT-prefix can also be available in a localized version from the resource file "iso8601.properties", given the key "prefixGMTOffset". |
| TIMEZONE_ID | V | The count of pattern symbols must always be 2. This symbol
can only be applied on the type Moment. |
| ISO_TIMEZONE_OFFSET | X | One symbol: ±HH[mm], two symbols: ±HHmm, three
symbols: ±HH:mm, four symbols: ±HHmm[ss[.{fraction}]],
five symbols: ±HH:mm[:ss[.{fraction}]]. If the timezone
offset is equal to 0 then the letter "Z" will
be used. |
| ISO_TIMEZONE_OFFSET | x | Like X but without the special char "Z" if the
timezone offset is equal to 0. |
public static final PatternType SIMPLE_DATE_FORMAT
Follows the format pattern description of class
SimpleDateFormat, which is very near, but not
exactly the same as CLDR.
The permitted count of digits is usually unlimited. Deviations
from CLDR:
| Element | Symbol | Description |
|---|---|---|
| ISO_DAY_OF_WEEK | u | Corresponds to the weekday-numbering of ISO-8601-standard
(Weekmodel.ISO.localDayOfWeek()), that is:
Mo=1, Di=2, Mi=3, Do=4, Fr=5, Sa=6, So=7. |
Weekmodel.boundedWeekOfMonth() |
W | One symbol for the country-dependent week of month. |
PlainTime.MILLI_OF_SECOND |
S | No fractional but only integral display of millisecond. |
| QUARTER_OF_YEAR | Q | Not supported (as work-around: use CLDR). |
| QUARTER_OF_YEAR | q | Not supported (as work-around: use CLDR). |
| MONTH_OF_YEAR | L | Not supported (as work-around: use CLDR). |
| MODIFIED_JULIAN_DATE | g | Not supported (as work-around: use CLDR). |
| {local-day-of-week-number} | e | Not supported (as work-around: use CLDR). |
| {local-day-of-week-number} | c | Not supported (as work-around: use CLDR). |
| RFC_822_TIMEZONE_OFFSET | Z | Equivalent to CLDR-xx. |
| LOCALIZED_GMT_OFFSET | O | Not supported (as work-around: use CLDR). |
| TIMEZONE_ID | V | Not supported (as work-around: use CLDR). |
| ISO_TIMEZONE_OFFSET | X | Like in CLDR, but with only three symbols as upper limit. |
| ISO_TIMEZONE_OFFSET | x | Not supported (as work-around: use CLDR). |
public static final PatternType CLDR_24
CLDR-variant with the only difference how the symbol "H" will be interpreted.
Deviations from CLDR:
| Element | Symbol | Description |
|---|---|---|
PlainTime.ISO_HOUR |
H | Hour of day as defined in ISO-8601 - in range 0-24 (the value 24 is only permitted if all other time parts are zero). |
public static final PatternType NON_ISO_DATE
A small subset of CLDR applicable on any non-ISO-chronology which has registered the associated elements with same symbols.
If not explicitly stated otherwise the count of symbols always controls the minimum count of digits in case of a numerical element. Is an element shorter then the zero digit will be used for padding.
| Element | Symbol | Description |
|---|---|---|
| ERA | G | One to three symbols indicate an abbreviation, four symbols indicate the long form and five symbols stand for a letter. |
| YEAR_OF_ERA | y | The count of symbols normally controls the minimum count of
digits. If it is 2 however then the year will be printed with
exact two digits using the attribute Attributes.PIVOT_YEAR. |
| MONTH_OF_YEAR | M | One or two symbols for the numerical form, three symbols for the abbreviation, four for the full name and five for a letter symbol (NARROW). |
| MONTH_OF_YEAR | L | Like M, but in the version OutputContext.STANDALONE.
In some languages (not english) the stand-alone-version requires
a special grammar. |
| DAY_OF_MONTH | d | One or two symbols for the day of month. |
| DAY_OF_YEAR | D | One, two or three symbols for the day of year. |
| DAY_OF_WEEK | E | One to three symbols for the abbreviation, four for the full name, five for a letter symbol or six for the short form. |
public static PatternType[] values()
for (PatternType c : PatternType.values()) System.out.println(c);
public static PatternType valueOf(java.lang.String name)
name - the name of the enum constant to be returned.java.lang.IllegalArgumentException - if this enum type has no constant with the specified namejava.lang.NullPointerException - if the argument is nullpublic FormatEngine<PatternType> getFormatEngine()
ChronoPatternYields the format engine this pattern is designed for.
getFormatEngine in interface ChronoPattern<PatternType>