枚举类的使用
java.time.format.TextStyle
使用 TextStyle 的包
包
描述
日期、时间、瞬间和持续时间的主要 API。
用于除默认 ISO 之外的日历系统的通用 API。
提供类来打印和解析日期和时间。
-
TextStyle 在 java.time 中的用法
修饰符和类型方法描述DayOfWeek.getDisplayName(TextStyle style, Locale locale) 获取文本表示形式,例如“星期一”或“星期五”。Month.getDisplayName(TextStyle style, Locale locale) 获取文本表示形式,例如“Jan”或“December”。ZoneId.getDisplayName(TextStyle style, Locale locale) 获取区域的文本表示形式,例如“英国时间”或“+02:00”。 -
TextStyle 在 java.time.chrono 中的用法
java.time.chrono 中的方法,参数类型为 TextStyle修饰符和类型方法描述default StringChronology.getDisplayName(TextStyle style, Locale locale) 获取此年表的文本表示。default StringEra.getDisplayName(TextStyle style, Locale locale) 获取这个时代的文本表示。HijrahEra.getDisplayName(TextStyle style, Locale locale) 获取这个时代的文本表示。JapaneseEra.getDisplayName(TextStyle style, Locale locale) 获取这个时代的文本表示。MinguoEra.getDisplayName(TextStyle style, Locale locale) 获取这个时代的文本表示。ThaiBuddhistEra.getDisplayName(TextStyle style, Locale locale) 获取这个时代的文本表示。 -
TextStyle 在 java.time.format 中的用法
java.time.format 中返回 TextStyle 的方法修饰符和类型方法描述TextStyle.asNormal()返回具有相同大小的普通样式。TextStyle.asStandalone()返回具有相同大小的独立样式。static TextStyle返回具有指定名称的此类的枚举常量。static TextStyle[]TextStyle.values()返回一个数组,其中包含此枚举类的常量,按照它们声明的顺序排列。java.time.format 中的方法,参数类型为 TextStyle修饰符和类型方法描述DateTimeFormatterBuilder.appendChronologyText(TextStyle textStyle) 将年表名称附加到格式化程序。DateTimeFormatterBuilder.appendDayPeriodText(TextStyle style) 将日期间文本附加到格式化程序。DateTimeFormatterBuilder.appendGenericZoneText(TextStyle textStyle) 将通用时区名称(例如“太平洋时间”)附加到格式化程序。DateTimeFormatterBuilder.appendGenericZoneText(TextStyle textStyle, Set<ZoneId> preferredZones) 将通用时区名称(例如“太平洋时间”)附加到格式化程序。DateTimeFormatterBuilder.appendLocalizedOffset(TextStyle style) 将本地化区域偏移量(例如“GMT+01:00”)附加到格式化程序。DateTimeFormatterBuilder.appendText(TemporalField field, TextStyle textStyle) 将日期时间字段的文本附加到格式化程序。DateTimeFormatterBuilder.appendZoneText(TextStyle textStyle) 将时区名称(例如“英国夏令时”)附加到格式化程序。DateTimeFormatterBuilder.appendZoneText(TextStyle textStyle, Set<ZoneId> preferredZones) 将时区名称(例如“英国夏令时”)附加到格式化程序。