public enum PatternType extends Enum<PatternType> implements ChronoPattern<PatternType>
Collection of different format patterns.
ChronoFormatter.Builder.addPattern(String, PatternType)
Enum Constant and Description 

CLDR
This standard pattern is applicable on many chronologies and follows the standard
LDML of unicodeconsortium.

CLDR_24
CLDRvariant with the only difference how the symbol "H" will be interpreted.

CLDR_DATE
A small subset of CLDR applicable on many calendar chronologies which have registered the
associated elements with same symbols.

DYNAMIC
Resolves a pattern such that the chronology used in current context determines the meaning
of any pattern symbols.

NON_ISO_DATE
Deprecated.
Use
CLDR_DATE as replacement because the name of this pattern type can be
confusing considering the fact that not all calendars can be handled by this pattern type
(for example, the FrenchRepublicanCalendar is not suitable here) 
SIMPLE_DATE_FORMAT
Follows the format pattern description of class
SimpleDateFormat , which is very near, but not
exactly the same as CLDR. 
THREETEN
Follows the format pattern description of class
DateTimeFormatter , which is very near, but not
exactly the same as CLDR and extends it in some details. 
Modifier and Type  Method and Description 

FormatEngine<PatternType> 
getFormatEngine()
Yields the format engine this pattern is designed for.

static PatternType 
valueOf(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 many chronologies and follows the standard LDML of unicodeconsortium.
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.
NonISOchronologies are also supported if their elements define CLDRsymbols.
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 ISO8601 week date and behaves like the calendar year in formatting. The weekbased year can deviate from the calendar year however because it is bound to the week cycle. 
PlainDate.YEAR 
u  Proleptic ISO8601 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 yearofera. 
RELATED_GREGORIAN_YEAR  r  The related gregorian year corresponds to the begin of the calendar year in nongregorian calender systems. In ISOcalendar systems, it is identical to the proleptic ISO8601 calendar year. For formatting or parsing, only the ASCIIdigits 09 will be used, even if other parts of the format use alternative digits or other numeral systems. The count of symbols is defined within the range 19. 
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 standaloneversion 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 standaloneversion requires
a special grammar. 
Weekmodel.weekOfYear() 
w  One or two symbols for the countrydependent week of year. 
Weekmodel.weekOfMonth() 
W  One symbol for the countrydependent 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 . 
DAY_OF_YEAR  D  One, two or three symbols for the day of year. Important: If the era is not present
then this symbol will simply be mapped to PlainDate.DAY_OF_YEAR . 
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 18581117. 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 standaloneversion requires
a special grammar. However, 2 symbols are not allowed. 
PlainTime.AM_PM_OF_DAY 
a  13 symbols for the short form, 4 symbols for the full text form and 5 symbols for the narrow form. 
DayPeriod.fixed() 
b  13 symbols for the short form, 4 symbols for the full text form and 5 symbols for the narrow form. 
DayPeriod.approximate() 
B  13 symbols for the short form, 4 symbols for the full text form and 5 symbols for the narrow form. 
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 (19) 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 (19) controls the minimum count of digits to be printed. 
TIMEZONE_NAME  z  13 symbols for the abbreviation, 4 symbols for the full
timezone name. The specific nonlocation format will be used,
for example "Pacific Daylight Time" (PDT) or
"Pacific Standard Time" (PST). This symbol
can only be applied on the type Moment . 
TIMEZONE_OFFSET  Z  13 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 GMTprefix can be suppressed by help of the format
attribute Attributes.NO_GMT_PREFIX . See also
ChronoFormatter.Builder.addLongLocalizedOffset()
or its short counter part. 
GENERIC_TIMEZONE_NAME  v  One symbol for the abbreviation or 4 symbols for the long variant. The generic nonlocation format will be used, for example "Pacific Time" (PT). 
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 . 
Special notes for the Ethiopian calendar:
The Ethiopian year will use the Ethiopic numerals in Amharic. This default behaviour can be overridden on builderlevel. And the clock time (symbol "h") will use the Ethiopian time starting at 6 AM in the morning.
Warning: CLDRlike date patterns are only applicable when the calendar in question always contains a month for any date. This underlying assumption is not true for example for the French revolutionary calendar.
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. Users should treat this setting
only as approximation to any real implementation of SimpleDateFormat
. For example,
this pattern style is only applicable on ISOcompatible chronologies. Other deviations from
CLDR
:
Element  Symbol  Description 

ISO_DAY_OF_WEEK  u  Corresponds to the weekdaynumbering of ISO8601standard
(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 countrydependent week of month. 
PlainTime.MILLI_OF_SECOND 
S  No fractional but only integral display of millisecond. 
QUARTER_OF_YEAR  Q  Not supported (as workaround: use CLDR). 
QUARTER_OF_YEAR  q  Not supported (as workaround: use CLDR). 
RELATED_GREGORIAN_YEAR  r  Not supported (as workaround: use CLDR). 
MODIFIED_JULIAN_DATE  g  Not supported (as workaround: use CLDR). 
{localdayofweeknumber}  e  Not supported (as workaround: use CLDR). 
{localdayofweeknumber}  c  Not supported (as workaround: use CLDR). 
PlainTime.AM_PM_OF_DAY 
a  Only the short form is supported. 
DayPeriod.fixed() 
b  Not supported (as workaround: use CLDR). 
DayPeriod.approximate() 
B  Not supported (as workaround: use CLDR). 
RFC_822_TIMEZONE_OFFSET  Z  Equivalent to CLDRxx. 
LOCALIZED_GMT_OFFSET  O  Not supported (as workaround: use CLDR). 
TIMEZONE_ID  V  Not supported (as workaround: use CLDR). 
ISO_TIMEZONE_OFFSET  X  Like in CLDR, but with only three symbols as upper limit. 
ISO_TIMEZONE_OFFSET  x  Not supported (as workaround: use CLDR). 
public static final PatternType THREETEN
Follows the format pattern description of class
DateTimeFormatter
, which is very near, but not
exactly the same as CLDR and extends it in some details.
Users should treat this setting only as approximation to the real behaviour in Java8.
For example, this pattern style is only applicable on ISOchronologies. Other deviations
from CLDR
:
Element  Symbol  Description 

ERA 
G  Like in CLDR, but related to the proleptic gregorian calendar. It is NOT the historic era. 
YEAR_OF_ERA 
y  Like in CLDR, but related to the proleptic gregorian calendar. It is NOT
the historic year of era. Another important difference: It will use the pivot year 2100
for the range 20002099 if the twodigitform is choosen. If you want to configure the pivot
year then use PatternType.CLDR instead. 
PlainDate.YEAR_OF_WEEKDATE 
Y  Like in CLDR, but the twodigitform will use the pivot year 2100 for the range 20002099.
If you want to configure the pivot year then use PatternType.CLDR instead. 
PlainDate.YEAR 
u  Like in CLDR, but the twodigitform will use the pivot year 2100 for the range 20002099.
If you want to configure the pivot year then use PatternType.CLDR and the symbol yy instead. 
RELATED_GREGORIAN_YEAR  r  Not supported (as workaround: use CLDR). 
EpochDays.MODIFIED_JULIAN_DATE 
g  Not supported (as workaround: use CLDR). 
Weekmodel.boundedWeekOfMonth() 
W  One symbol for the countrydependent week of month. 
PlainDate.DAY_OF_WEEK 
E  Like in CLDR, but no more than five pattern symbols are allowed. 
Weekmodel.localDayOfWeek() 
e  Like in CLDR, but no more than five pattern symbols are allowed. 
Weekmodel.localDayOfWeek() 
c  Like in CLDR, but no more than five pattern symbols are allowed. 
DayPeriod.fixed() 
b  Not supported (as workaround: use CLDR). 
DayPeriod.approximate() 
B  Not supported (as workaround: use CLDR). 
PlainTime.NANO_OF_SECOND 
n  19 symbols allowed, no CLDRequivalent. 
PlainTime.NANO_OF_DAY 
N  118 symbols allowed, no CLDRequivalent. 
ChronoFormatter.Builder.padNext(int) 
p  No CLDRequivalent. 
TIMEZONE_NAME  z  Similar to CLDR but if applied on "local" types then it behaves like symbol "v" (generic location format). 
public static final PatternType CLDR_24
CLDRvariant with the only difference how the symbol "H" will be interpreted.
Deviations from CLDR
:
Element  Symbol  Description 

PlainTime.HOUR_FROM_0_TO_24 
H  Hour of day  in full range 024 (the value 24 is only permitted if all other time parts are zero). 
public static final PatternType CLDR_DATE
A small subset of CLDR applicable on many calendar chronologies which have 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 standaloneversion requires
a special grammar. 
WEEK_OF_YEAR  w  One or two symbols for the countrydependent week of year. 
WEEK_OF_MONTH  W  One symbol for the countrydependent week of month. 
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. 
WEEKDAY_IN_MONTH  F  One symbol for the weekday in month. 
LOCAL_DAY_OF_WEEK  e  Like E, but if there are only one or two symbols then the formatter will choose the localized numerical form. 
LOCAL_DAY_OF_WEEK  c  Like e, but in the version OutputContext.STANDALONE .
In some languages (not english) the standaloneversion requires
a special grammar. However, 2 symbols are not allowed. 
RELATED_GREGORIAN_YEAR  r  The related gregorian year corresponds to the begin of the calendar year in nongregorian calender systems. For formatting or parsing, only the ASCIIdigits 09 will be used, even if other parts of the format use alternative digits or other numeral systems. The count of symbols is defined within the range 19. 
Special notes for the Ethiopian calendar:
The Ethiopian year will use the Ethiopic numerals in Amharic. This default behaviour can be overridden on builderlevel using a sectional attribute for the number system.
Warning: CLDRlike date patterns are only applicable when the calendar in question always contains a month for any date. This underlying assumption is not true for example for the French revolutionary calendar.
@Deprecated public static final PatternType NON_ISO_DATE
CLDR_DATE
as replacement because the name of this pattern type can be
confusing considering the fact that not all calendars can be handled by this pattern type
(for example, the FrenchRepublicanCalendar
is not suitable here)A small subset of CLDR applicable on any nonISOchronology 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 standaloneversion requires
a special grammar. 
WEEK_OF_YEAR  w  One or two symbols for the countrydependent week of year. 
WEEK_OF_MONTH  W  One symbol for the countrydependent week of month. 
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. 
WEEKDAY_IN_MONTH  F  One symbol for the weekday in month. 
LOCAL_DAY_OF_WEEK  e  Like E, but if there are only one or two symbols then the formatter will choose the localized numerical form. 
LOCAL_DAY_OF_WEEK  c  Like e, but in the version OutputContext.STANDALONE .
In some languages (not english) the standaloneversion requires
a special grammar. However, 2 symbols are not allowed. 
RELATED_GREGORIAN_YEAR  r  The related gregorian year corresponds to the begin of the calendar year in nongregorian calender systems. For formatting or parsing, only the ASCIIdigits 09 will be used, even if other parts of the format use alternative digits or other numeral systems. The count of symbols is defined within the range 19. 
Special notes for the Ethiopian calendar:
The Ethiopian year will use the Ethiopic numerals in Amharic. This default behaviour can be overridden on builderlevel.
public static final PatternType DYNAMIC
Resolves a pattern such that the chronology used in current context determines the meaning of any pattern symbols.
In contrast to other pattern types like CLDR
, the meaning of pattern symbols is not
defined by any external standard. The elements associated with symbols are looked up among the registered
elements of a chronology including those which can be found via any chronological extension. If the
found element is a text element
then it will be treated as such, and the count of
symbols determines the text width (1 = NARROW, 2 = SHORT, 3 = ABBREVIATED, 4 = WIDE). Otherwise
this pattern type tries to resolve the element in question as ChronoElement<Integer>
, and
the count of symbols will determine the min width of displayed/parsed digits and apply some padding
if necessary. The maximum width is always 9, and no sign is used.
ChronoElement.getSymbol()
public static PatternType[] values()
for (PatternType c : PatternType.values()) System.out.println(c);
public static PatternType valueOf(String name)
name
 the name of the enum constant to be returned.IllegalArgumentException
 if this enum type has no constant with the specified nameNullPointerException
 if the argument is nullpublic FormatEngine<PatternType> getFormatEngine()
ChronoPattern
Yields the format engine this pattern is designed for.
getFormatEngine
in interface ChronoPattern<PatternType>
Copyright © 2014–2018. All rights reserved.