本文整理汇总了Java中java.time.format.TextStyle.FULL属性的典型用法代码示例。如果您正苦于以下问题:Java TextStyle.FULL属性的具体用法?Java TextStyle.FULL怎么用?Java TextStyle.FULL使用的例子?那么, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在类java.time.format.TextStyle
的用法示例。
在下文中一共展示了TextStyle.FULL属性的13个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: data_preferredZones
@DataProvider(name="preferredZones")
Object[][] data_preferredZones() {
return new Object[][] {
{"America/New_York", "Eastern Standard Time", none, Locale.ENGLISH, TextStyle.FULL},
// {"EST", "Eastern Standard Time", preferred, Locale.ENGLISH, TextStyle.FULL},
{"Europe/Paris", "Central European Time", none, Locale.ENGLISH, TextStyle.FULL},
{"CET", "Central European Time", preferred, Locale.ENGLISH, TextStyle.FULL},
{"Asia/Shanghai", "China Standard Time", none, Locale.ENGLISH, TextStyle.FULL},
{"Asia/Taipei", "China Standard Time", preferred, Locale.ENGLISH, TextStyle.FULL},
{"America/Chicago", "CST", none, Locale.ENGLISH, TextStyle.SHORT},
{"Asia/Taipei", "CST", preferred, Locale.ENGLISH, TextStyle.SHORT},
{"Australia/South", "ACST", preferred_s, Locale.ENGLISH, TextStyle.SHORT},
{"America/Chicago", "CDT", none, Locale.ENGLISH, TextStyle.SHORT},
{"Asia/Shanghai", "CDT", preferred_s, Locale.ENGLISH, TextStyle.SHORT},
};
}
示例2: parseText
private void parseText(Set<String> zids, Locale locale, TextStyle style, boolean ci) {
System.out.println("---------------------------------------");
DateTimeFormatter fmt = getFormatter(locale, style, ci);
for (String[] names : new DateFormatSymbols(locale).getZoneStrings()) {
if (!zids.contains(names[0])) {
continue;
}
String zid = names[0];
String expected = ZoneName.toZid(zid, locale);
parse(fmt, zid, expected, zid, locale, style, ci);
int i = style == TextStyle.FULL ? 1 : 2;
for (; i < names.length; i += 2) {
parse(fmt, zid, expected, names[i], locale, style, ci);
}
}
}
示例3: provider_japaneseEra
@DataProvider(name="print_JapaneseChronology")
Object[][] provider_japaneseEra() {
return new Object[][] {
{ERA, TextStyle.FULL, 2, "Heisei"}, // Note: CLDR doesn't define "wide" Japanese era names.
{ERA, TextStyle.SHORT, 2, "Heisei"},
{ERA, TextStyle.NARROW, 2, "H"},
};
}
示例4: data_preferredZones
@DataProvider(name="preferredZones")
Object[][] data_preferredZones() {
return new Object[][] {
{"America/New_York", "Eastern Standard Time", none, Locale.ENGLISH, TextStyle.FULL},
// {"EST", "Eastern Standard Time", preferred, Locale.ENGLISH, TextStyle.FULL},
{"Europe/Paris", "Central European Time", none, Locale.ENGLISH, TextStyle.FULL},
// {"CET", "Central European Time", preferred, Locale.ENGLISH, TextStyle.FULL}, no three-letter ID in CLDR
{"Asia/Shanghai", "China Standard Time", none, Locale.ENGLISH, TextStyle.FULL},
{"Asia/Macau", "China Standard Time", preferred, Locale.ENGLISH, TextStyle.FULL},
{"Asia/Taipei", "Taipei Standard Time", preferred, Locale.ENGLISH, TextStyle.FULL},
{"America/Chicago", "CST", none, Locale.ENGLISH, TextStyle.SHORT},
{"Asia/Taipei", "CST", preferred, Locale.ENGLISH, TextStyle.SHORT},
{"Australia/South", "ACST", preferred_s, Locale.ENGLISH, TextStyle.SHORT},
{"America/Chicago", "CDT", none, Locale.ENGLISH, TextStyle.SHORT},
{"Asia/Shanghai", "CDT", preferred_s, Locale.ENGLISH, TextStyle.SHORT},
};
}
示例5: test_appendText1arg_format
@Test(dataProvider="printText")
public void test_appendText1arg_format(TemporalField field, TextStyle style, int value, String expected) throws Exception {
if (style == TextStyle.FULL) {
DateTimeFormatter f = builder.appendText(field).toFormatter(Locale.ENGLISH);
LocalDateTime dt = LocalDateTime.of(2010, 1, 1, 0, 0);
dt = dt.with(field, value);
String text = f.format(dt);
assertEquals(text, expected);
}
}
示例6: data_print_localized
@DataProvider(name="print_localized")
Object[][] data_print_localized() {
return new Object[][] {
{TextStyle.FULL, DT_2012_06_30_12_30_40, OFFSET_UTC, "GMT"},
{TextStyle.FULL, DT_2012_06_30_12_30_40, OFFSET_P0100, "GMT+01:00"},
{TextStyle.FULL, DT_2012_06_30_12_30_40, OFFSET_P0123, "GMT+01:23"},
{TextStyle.FULL, DT_2012_06_30_12_30_40, OFFSET_P0023, "GMT+00:23"},
{TextStyle.FULL, DT_2012_06_30_12_30_40, OFFSET_P012345, "GMT+01:23:45"},
{TextStyle.FULL, DT_2012_06_30_12_30_40, OFFSET_M000045, "GMT-00:00:45"},
{TextStyle.FULL, DT_2012_06_30_12_30_40, OFFSET_M0100, "GMT-01:00"},
{TextStyle.FULL, DT_2012_06_30_12_30_40, OFFSET_M0123, "GMT-01:23"},
{TextStyle.FULL, DT_2012_06_30_12_30_40, OFFSET_M0023, "GMT-00:23"},
{TextStyle.FULL, DT_2012_06_30_12_30_40, OFFSET_M012345, "GMT-01:23:45"},
{TextStyle.FULL, DT_2012_06_30_12_30_40, OFFSET_M000045, "GMT-00:00:45"},
{TextStyle.SHORT, DT_2012_06_30_12_30_40, OFFSET_UTC, "GMT"},
{TextStyle.SHORT, DT_2012_06_30_12_30_40, OFFSET_P0100, "GMT+1"},
{TextStyle.SHORT, DT_2012_06_30_12_30_40, OFFSET_P0123, "GMT+1:23"},
{TextStyle.SHORT, DT_2012_06_30_12_30_40, OFFSET_P0023, "GMT+0:23"},
{TextStyle.SHORT, DT_2012_06_30_12_30_40, OFFSET_P012345, "GMT+1:23:45"},
{TextStyle.SHORT, DT_2012_06_30_12_30_40, OFFSET_M000045, "GMT-0:00:45"},
{TextStyle.SHORT, DT_2012_06_30_12_30_40, OFFSET_M0100, "GMT-1"},
{TextStyle.SHORT, DT_2012_06_30_12_30_40, OFFSET_M0123, "GMT-1:23"},
{TextStyle.SHORT, DT_2012_06_30_12_30_40, OFFSET_M0023, "GMT-0:23"},
{TextStyle.SHORT, DT_2012_06_30_12_30_40, OFFSET_M012345, "GMT-1:23:45"},
{TextStyle.SHORT, DT_2012_06_30_12_30_40, OFFSET_M000045, "GMT-0:00:45"},
};
}
示例7: test_print_localized
@Test(dataProvider="print_localized")
public void test_print_localized(TextStyle style, LocalDateTime ldt, ZoneOffset offset, String expected) {
OffsetDateTime odt = OffsetDateTime.of(ldt, offset);
ZonedDateTime zdt = ldt.atZone(offset);
DateTimeFormatter f = new DateTimeFormatterBuilder().appendLocalizedOffset(style)
.toFormatter();
assertEquals(f.format(odt), expected);
assertEquals(f.format(zdt), expected);
assertEquals(f.parse(expected, ZoneOffset::from), offset);
if (style == TextStyle.FULL) {
f = new DateTimeFormatterBuilder().appendPattern("ZZZZ")
.toFormatter();
assertEquals(f.format(odt), expected);
assertEquals(f.format(zdt), expected);
assertEquals(f.parse(expected, ZoneOffset::from), offset);
f = new DateTimeFormatterBuilder().appendPattern("OOOO")
.toFormatter();
assertEquals(f.format(odt), expected);
assertEquals(f.format(zdt), expected);
assertEquals(f.parse(expected, ZoneOffset::from), offset);
}
if (style == TextStyle.SHORT) {
f = new DateTimeFormatterBuilder().appendPattern("O")
.toFormatter();
assertEquals(f.format(odt), expected);
assertEquals(f.format(zdt), expected);
assertEquals(f.parse(expected, ZoneOffset::from), offset);
}
}
示例8: data_error
@DataProvider(name="error")
Object[][] data_error() {
return new Object[][] {
{DAY_OF_WEEK, TextStyle.FULL, "Monday", -1, IndexOutOfBoundsException.class},
{DAY_OF_WEEK, TextStyle.FULL, "Monday", 7, IndexOutOfBoundsException.class},
};
}
示例9: provider_number
@DataProvider(name="parseNumber")
Object[][] provider_number() {
return new Object[][] {
{DAY_OF_MONTH, TextStyle.FULL, 1, "1"},
{DAY_OF_MONTH, TextStyle.FULL, 2, "2"},
{DAY_OF_MONTH, TextStyle.FULL, 30, "30"},
{DAY_OF_MONTH, TextStyle.FULL, 31, "31"},
{DAY_OF_MONTH, TextStyle.SHORT, 1, "1"},
{DAY_OF_MONTH, TextStyle.SHORT, 2, "2"},
{DAY_OF_MONTH, TextStyle.SHORT, 30, "30"},
{DAY_OF_MONTH, TextStyle.SHORT, 31, "31"},
};
}
示例10: data_text
@DataProvider(name="printText")
Object[][] data_text() {
return new Object[][] {
{DAY_OF_WEEK, TextStyle.FULL, 1, "Monday"},
{DAY_OF_WEEK, TextStyle.FULL, 2, "Tuesday"},
{DAY_OF_WEEK, TextStyle.FULL, 3, "Wednesday"},
{DAY_OF_WEEK, TextStyle.FULL, 4, "Thursday"},
{DAY_OF_WEEK, TextStyle.FULL, 5, "Friday"},
{DAY_OF_WEEK, TextStyle.FULL, 6, "Saturday"},
{DAY_OF_WEEK, TextStyle.FULL, 7, "Sunday"},
{DAY_OF_WEEK, TextStyle.SHORT, 1, "Mon"},
{DAY_OF_WEEK, TextStyle.SHORT, 2, "Tue"},
{DAY_OF_WEEK, TextStyle.SHORT, 3, "Wed"},
{DAY_OF_WEEK, TextStyle.SHORT, 4, "Thu"},
{DAY_OF_WEEK, TextStyle.SHORT, 5, "Fri"},
{DAY_OF_WEEK, TextStyle.SHORT, 6, "Sat"},
{DAY_OF_WEEK, TextStyle.SHORT, 7, "Sun"},
{DAY_OF_MONTH, TextStyle.FULL, 1, "1"},
{DAY_OF_MONTH, TextStyle.FULL, 2, "2"},
{DAY_OF_MONTH, TextStyle.FULL, 3, "3"},
{DAY_OF_MONTH, TextStyle.FULL, 28, "28"},
{DAY_OF_MONTH, TextStyle.FULL, 29, "29"},
{DAY_OF_MONTH, TextStyle.FULL, 30, "30"},
{DAY_OF_MONTH, TextStyle.FULL, 31, "31"},
{DAY_OF_MONTH, TextStyle.SHORT, 1, "1"},
{DAY_OF_MONTH, TextStyle.SHORT, 2, "2"},
{DAY_OF_MONTH, TextStyle.SHORT, 3, "3"},
{DAY_OF_MONTH, TextStyle.SHORT, 28, "28"},
{DAY_OF_MONTH, TextStyle.SHORT, 29, "29"},
{DAY_OF_MONTH, TextStyle.SHORT, 30, "30"},
{DAY_OF_MONTH, TextStyle.SHORT, 31, "31"},
{MONTH_OF_YEAR, TextStyle.FULL, 1, "January"},
{MONTH_OF_YEAR, TextStyle.FULL, 12, "December"},
{MONTH_OF_YEAR, TextStyle.SHORT, 1, "Jan"},
{MONTH_OF_YEAR, TextStyle.SHORT, 12, "Dec"},
};
}
示例11: provider_text
@DataProvider(name="parseText")
Object[][] provider_text() {
return new Object[][] {
{DAY_OF_WEEK, TextStyle.FULL, 1, "Monday"},
{DAY_OF_WEEK, TextStyle.FULL, 2, "Tuesday"},
{DAY_OF_WEEK, TextStyle.FULL, 3, "Wednesday"},
{DAY_OF_WEEK, TextStyle.FULL, 4, "Thursday"},
{DAY_OF_WEEK, TextStyle.FULL, 5, "Friday"},
{DAY_OF_WEEK, TextStyle.FULL, 6, "Saturday"},
{DAY_OF_WEEK, TextStyle.FULL, 7, "Sunday"},
{DAY_OF_WEEK, TextStyle.SHORT, 1, "Mon"},
{DAY_OF_WEEK, TextStyle.SHORT, 2, "Tue"},
{DAY_OF_WEEK, TextStyle.SHORT, 3, "Wed"},
{DAY_OF_WEEK, TextStyle.SHORT, 4, "Thu"},
{DAY_OF_WEEK, TextStyle.SHORT, 5, "Fri"},
{DAY_OF_WEEK, TextStyle.SHORT, 6, "Sat"},
{DAY_OF_WEEK, TextStyle.SHORT, 7, "Sun"},
{MONTH_OF_YEAR, TextStyle.FULL, 1, "January"},
{MONTH_OF_YEAR, TextStyle.FULL, 12, "December"},
{MONTH_OF_YEAR, TextStyle.SHORT, 1, "Jan"},
{MONTH_OF_YEAR, TextStyle.SHORT, 12, "Dec"},
{QUARTER_OF_YEAR, TextStyle.FULL, 1, "1st quarter"},
{QUARTER_OF_YEAR, TextStyle.FULL, 2, "2nd quarter"},
{QUARTER_OF_YEAR, TextStyle.FULL, 3, "3rd quarter"},
{QUARTER_OF_YEAR, TextStyle.FULL, 4, "4th quarter"},
{QUARTER_OF_YEAR, TextStyle.SHORT, 1, "Q1"},
{QUARTER_OF_YEAR, TextStyle.SHORT, 2, "Q2"},
{QUARTER_OF_YEAR, TextStyle.SHORT, 3, "Q3"},
{QUARTER_OF_YEAR, TextStyle.SHORT, 4, "Q4"},
{QUARTER_OF_YEAR, TextStyle.NARROW, 1, "1"},
{QUARTER_OF_YEAR, TextStyle.NARROW, 2, "2"},
{QUARTER_OF_YEAR, TextStyle.NARROW, 3, "3"},
{QUARTER_OF_YEAR, TextStyle.NARROW, 4, "4"},
};
}
示例12: data_text
@DataProvider(name = "Text")
Object[][] data_text() {
return new Object[][] {
{DAY_OF_WEEK, 1, TextStyle.SHORT, enUS, "Mon"},
{DAY_OF_WEEK, 2, TextStyle.SHORT, enUS, "Tue"},
{DAY_OF_WEEK, 3, TextStyle.SHORT, enUS, "Wed"},
{DAY_OF_WEEK, 4, TextStyle.SHORT, enUS, "Thu"},
{DAY_OF_WEEK, 5, TextStyle.SHORT, enUS, "Fri"},
{DAY_OF_WEEK, 6, TextStyle.SHORT, enUS, "Sat"},
{DAY_OF_WEEK, 7, TextStyle.SHORT, enUS, "Sun"},
{DAY_OF_WEEK, 1, TextStyle.FULL, enUS, "Monday"},
{DAY_OF_WEEK, 2, TextStyle.FULL, enUS, "Tuesday"},
{DAY_OF_WEEK, 3, TextStyle.FULL, enUS, "Wednesday"},
{DAY_OF_WEEK, 4, TextStyle.FULL, enUS, "Thursday"},
{DAY_OF_WEEK, 5, TextStyle.FULL, enUS, "Friday"},
{DAY_OF_WEEK, 6, TextStyle.FULL, enUS, "Saturday"},
{DAY_OF_WEEK, 7, TextStyle.FULL, enUS, "Sunday"},
{MONTH_OF_YEAR, 1, TextStyle.SHORT, enUS, "Jan"},
{MONTH_OF_YEAR, 2, TextStyle.SHORT, enUS, "Feb"},
{MONTH_OF_YEAR, 3, TextStyle.SHORT, enUS, "Mar"},
{MONTH_OF_YEAR, 4, TextStyle.SHORT, enUS, "Apr"},
{MONTH_OF_YEAR, 5, TextStyle.SHORT, enUS, "May"},
{MONTH_OF_YEAR, 6, TextStyle.SHORT, enUS, "Jun"},
{MONTH_OF_YEAR, 7, TextStyle.SHORT, enUS, "Jul"},
{MONTH_OF_YEAR, 8, TextStyle.SHORT, enUS, "Aug"},
{MONTH_OF_YEAR, 9, TextStyle.SHORT, enUS, "Sep"},
{MONTH_OF_YEAR, 10, TextStyle.SHORT, enUS, "Oct"},
{MONTH_OF_YEAR, 11, TextStyle.SHORT, enUS, "Nov"},
{MONTH_OF_YEAR, 12, TextStyle.SHORT, enUS, "Dec"},
{MONTH_OF_YEAR, 1, TextStyle.FULL, enUS, "January"},
{MONTH_OF_YEAR, 2, TextStyle.FULL, enUS, "February"},
{MONTH_OF_YEAR, 3, TextStyle.FULL, enUS, "March"},
{MONTH_OF_YEAR, 4, TextStyle.FULL, enUS, "April"},
{MONTH_OF_YEAR, 5, TextStyle.FULL, enUS, "May"},
{MONTH_OF_YEAR, 6, TextStyle.FULL, enUS, "June"},
{MONTH_OF_YEAR, 7, TextStyle.FULL, enUS, "July"},
{MONTH_OF_YEAR, 8, TextStyle.FULL, enUS, "August"},
{MONTH_OF_YEAR, 9, TextStyle.FULL, enUS, "September"},
{MONTH_OF_YEAR, 10, TextStyle.FULL, enUS, "October"},
{MONTH_OF_YEAR, 11, TextStyle.FULL, enUS, "November"},
{MONTH_OF_YEAR, 12, TextStyle.FULL, enUS, "December"},
{AMPM_OF_DAY, 0, TextStyle.SHORT, enUS, "AM"},
{AMPM_OF_DAY, 1, TextStyle.SHORT, enUS, "PM"},
};
}
示例13: MonthHeaderCell
/**
* Constructs a new month header cell.
*
* @param view the view where the header is needed
* @param yearMonth the month to display
*/
public MonthHeaderCell(MonthSheetView view, YearMonth yearMonth) {
this(view, yearMonth, TextStyle.FULL);
}