Java Code Examples for java.time.chrono.Chronology#getCalendarType()

The following examples show how to use java.time.chrono.Chronology#getCalendarType() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: DateTimeFormatterBuilder.java    From jdk1.8-source-analysis with Apache License 2.0 2 votes vote down vote up
/**
 * Returns the chronology name of the given chrono in the given locale
 * if available, or the chronology Id otherwise. The regular ResourceBundle
 * search path is used for looking up the chronology name.
 *
 * @param chrono  the chronology, not null
 * @param locale  the locale, not null
 * @return the chronology name of chrono in locale, or the id if no name is available
 * @throws NullPointerException if chrono or locale is null
 */
private String getChronologyName(Chronology chrono, Locale locale) {
    String key = "calendarname." + chrono.getCalendarType();
    String name = DateTimeTextProvider.getLocalizedResource(key, locale);
    return name != null ? name : chrono.getId();
}
 
Example 2
Source File: DateTimeFormatterBuilder.java    From dragonwell8_jdk with GNU General Public License v2.0 2 votes vote down vote up
/**
 * Returns the chronology name of the given chrono in the given locale
 * if available, or the chronology Id otherwise. The regular ResourceBundle
 * search path is used for looking up the chronology name.
 *
 * @param chrono  the chronology, not null
 * @param locale  the locale, not null
 * @return the chronology name of chrono in locale, or the id if no name is available
 * @throws NullPointerException if chrono or locale is null
 */
private String getChronologyName(Chronology chrono, Locale locale) {
    String key = "calendarname." + chrono.getCalendarType();
    String name = DateTimeTextProvider.getLocalizedResource(key, locale);
    return name != null ? name : chrono.getId();
}
 
Example 3
Source File: DateTimeFormatterBuilder.java    From TencentKona-8 with GNU General Public License v2.0 2 votes vote down vote up
/**
 * Returns the chronology name of the given chrono in the given locale
 * if available, or the chronology Id otherwise. The regular ResourceBundle
 * search path is used for looking up the chronology name.
 *
 * @param chrono  the chronology, not null
 * @param locale  the locale, not null
 * @return the chronology name of chrono in locale, or the id if no name is available
 * @throws NullPointerException if chrono or locale is null
 */
private String getChronologyName(Chronology chrono, Locale locale) {
    String key = "calendarname." + chrono.getCalendarType();
    String name = DateTimeTextProvider.getLocalizedResource(key, locale);
    return name != null ? name : chrono.getId();
}
 
Example 4
Source File: DateTimeFormatterBuilder.java    From jdk8u60 with GNU General Public License v2.0 2 votes vote down vote up
/**
 * Returns the chronology name of the given chrono in the given locale
 * if available, or the chronology Id otherwise. The regular ResourceBundle
 * search path is used for looking up the chronology name.
 *
 * @param chrono  the chronology, not null
 * @param locale  the locale, not null
 * @return the chronology name of chrono in locale, or the id if no name is available
 * @throws NullPointerException if chrono or locale is null
 */
private String getChronologyName(Chronology chrono, Locale locale) {
    String key = "calendarname." + chrono.getCalendarType();
    String name = DateTimeTextProvider.getLocalizedResource(key, locale);
    return name != null ? name : chrono.getId();
}
 
Example 5
Source File: DateTimeFormatterBuilder.java    From JDKSourceCode1.8 with MIT License 2 votes vote down vote up
/**
 * Returns the chronology name of the given chrono in the given locale
 * if available, or the chronology Id otherwise. The regular ResourceBundle
 * search path is used for looking up the chronology name.
 *
 * @param chrono  the chronology, not null
 * @param locale  the locale, not null
 * @return the chronology name of chrono in locale, or the id if no name is available
 * @throws NullPointerException if chrono or locale is null
 */
private String getChronologyName(Chronology chrono, Locale locale) {
    String key = "calendarname." + chrono.getCalendarType();
    String name = DateTimeTextProvider.getLocalizedResource(key, locale);
    return name != null ? name : chrono.getId();
}
 
Example 6
Source File: DateTimeFormatterBuilder.java    From openjdk-jdk8u with GNU General Public License v2.0 2 votes vote down vote up
/**
 * Returns the chronology name of the given chrono in the given locale
 * if available, or the chronology Id otherwise. The regular ResourceBundle
 * search path is used for looking up the chronology name.
 *
 * @param chrono  the chronology, not null
 * @param locale  the locale, not null
 * @return the chronology name of chrono in locale, or the id if no name is available
 * @throws NullPointerException if chrono or locale is null
 */
private String getChronologyName(Chronology chrono, Locale locale) {
    String key = "calendarname." + chrono.getCalendarType();
    String name = DateTimeTextProvider.getLocalizedResource(key, locale);
    return name != null ? name : chrono.getId();
}
 
Example 7
Source File: DateTimeFormatterBuilder.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 2 votes vote down vote up
/**
 * Returns the chronology name of the given chrono in the given locale
 * if available, or the chronology Id otherwise. The regular ResourceBundle
 * search path is used for looking up the chronology name.
 *
 * @param chrono  the chronology, not null
 * @param locale  the locale, not null
 * @return the chronology name of chrono in locale, or the id if no name is available
 * @throws NullPointerException if chrono or locale is null
 */
private String getChronologyName(Chronology chrono, Locale locale) {
    String key = "calendarname." + chrono.getCalendarType();
    String name = DateTimeTextProvider.getLocalizedResource(key, locale);
    return name != null ? name : chrono.getId();
}
 
Example 8
Source File: DateTimeFormatterBuilder.java    From jdk8u-jdk with GNU General Public License v2.0 2 votes vote down vote up
/**
 * Returns the chronology name of the given chrono in the given locale
 * if available, or the chronology Id otherwise. The regular ResourceBundle
 * search path is used for looking up the chronology name.
 *
 * @param chrono  the chronology, not null
 * @param locale  the locale, not null
 * @return the chronology name of chrono in locale, or the id if no name is available
 * @throws NullPointerException if chrono or locale is null
 */
private String getChronologyName(Chronology chrono, Locale locale) {
    String key = "calendarname." + chrono.getCalendarType();
    String name = DateTimeTextProvider.getLocalizedResource(key, locale);
    return name != null ? name : chrono.getId();
}
 
Example 9
Source File: DateTimeFormatterBuilder.java    From Java8CN with Apache License 2.0 2 votes vote down vote up
/**
 * Returns the chronology name of the given chrono in the given locale
 * if available, or the chronology Id otherwise. The regular ResourceBundle
 * search path is used for looking up the chronology name.
 *
 * @param chrono  the chronology, not null
 * @param locale  the locale, not null
 * @return the chronology name of chrono in locale, or the id if no name is available
 * @throws NullPointerException if chrono or locale is null
 */
private String getChronologyName(Chronology chrono, Locale locale) {
    String key = "calendarname." + chrono.getCalendarType();
    String name = DateTimeTextProvider.getLocalizedResource(key, locale);
    return name != null ? name : chrono.getId();
}
 
Example 10
Source File: DateTimeFormatterBuilder.java    From hottub with GNU General Public License v2.0 2 votes vote down vote up
/**
 * Returns the chronology name of the given chrono in the given locale
 * if available, or the chronology Id otherwise. The regular ResourceBundle
 * search path is used for looking up the chronology name.
 *
 * @param chrono  the chronology, not null
 * @param locale  the locale, not null
 * @return the chronology name of chrono in locale, or the id if no name is available
 * @throws NullPointerException if chrono or locale is null
 */
private String getChronologyName(Chronology chrono, Locale locale) {
    String key = "calendarname." + chrono.getCalendarType();
    String name = DateTimeTextProvider.getLocalizedResource(key, locale);
    return name != null ? name : chrono.getId();
}
 
Example 11
Source File: DateTimeFormatterBuilder.java    From openjdk-8-source with GNU General Public License v2.0 2 votes vote down vote up
/**
 * Returns the chronology name of the given chrono in the given locale
 * if available, or the chronology Id otherwise. The regular ResourceBundle
 * search path is used for looking up the chronology name.
 *
 * @param chrono  the chronology, not null
 * @param locale  the locale, not null
 * @return the chronology name of chrono in locale, or the id if no name is available
 * @throws NullPointerException if chrono or locale is null
 */
private String getChronologyName(Chronology chrono, Locale locale) {
    String key = "calendarname." + chrono.getCalendarType();
    String name = DateTimeTextProvider.getLocalizedResource(key, locale);
    return name != null ? name : chrono.getId();
}
 
Example 12
Source File: DateTimeFormatterBuilder.java    From openjdk-8 with GNU General Public License v2.0 2 votes vote down vote up
/**
 * Returns the chronology name of the given chrono in the given locale
 * if available, or the chronology Id otherwise. The regular ResourceBundle
 * search path is used for looking up the chronology name.
 *
 * @param chrono  the chronology, not null
 * @param locale  the locale, not null
 * @return the chronology name of chrono in locale, or the id if no name is available
 * @throws NullPointerException if chrono or locale is null
 */
private String getChronologyName(Chronology chrono, Locale locale) {
    String key = "calendarname." + chrono.getCalendarType();
    String name = DateTimeTextProvider.getLocalizedResource(key, locale);
    return name != null ? name : chrono.getId();
}
 
Example 13
Source File: DateTimeFormatterBuilder.java    From jdk8u_jdk with GNU General Public License v2.0 2 votes vote down vote up
/**
 * Returns the chronology name of the given chrono in the given locale
 * if available, or the chronology Id otherwise. The regular ResourceBundle
 * search path is used for looking up the chronology name.
 *
 * @param chrono  the chronology, not null
 * @param locale  the locale, not null
 * @return the chronology name of chrono in locale, or the id if no name is available
 * @throws NullPointerException if chrono or locale is null
 */
private String getChronologyName(Chronology chrono, Locale locale) {
    String key = "calendarname." + chrono.getCalendarType();
    String name = DateTimeTextProvider.getLocalizedResource(key, locale);
    return name != null ? name : chrono.getId();
}
 
Example 14
Source File: DateTimeFormatterBuilder.java    From jdk8u-jdk with GNU General Public License v2.0 2 votes vote down vote up
/**
 * Returns the chronology name of the given chrono in the given locale
 * if available, or the chronology Id otherwise. The regular ResourceBundle
 * search path is used for looking up the chronology name.
 *
 * @param chrono  the chronology, not null
 * @param locale  the locale, not null
 * @return the chronology name of chrono in locale, or the id if no name is available
 * @throws NullPointerException if chrono or locale is null
 */
private String getChronologyName(Chronology chrono, Locale locale) {
    String key = "calendarname." + chrono.getCalendarType();
    String name = DateTimeTextProvider.getLocalizedResource(key, locale);
    return name != null ? name : chrono.getId();
}
 
Example 15
Source File: DateTimeFormatterBuilder.java    From jdk8u-dev-jdk with GNU General Public License v2.0 2 votes vote down vote up
/**
 * Returns the chronology name of the given chrono in the given locale
 * if available, or the chronology Id otherwise. The regular ResourceBundle
 * search path is used for looking up the chronology name.
 *
 * @param chrono  the chronology, not null
 * @param locale  the locale, not null
 * @return the chronology name of chrono in locale, or the id if no name is available
 * @throws NullPointerException if chrono or locale is null
 */
private String getChronologyName(Chronology chrono, Locale locale) {
    String key = "calendarname." + chrono.getCalendarType();
    String name = DateTimeTextProvider.getLocalizedResource(key, locale);
    return name != null ? name : chrono.getId();
}