sun.util.locale.provider.LocaleServiceProviderPool Java Examples

The following examples show how to use sun.util.locale.provider.LocaleServiceProviderPool. 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: Locale.java    From jdk8u-dev-jdk with GNU General Public License v2.0 6 votes vote down vote up
private String getDisplayString(String code, Locale inLocale, int type) {
    if (code.length() == 0) {
        return "";
    }

    if (inLocale == null) {
        throw new NullPointerException();
    }

    LocaleServiceProviderPool pool =
        LocaleServiceProviderPool.getPool(LocaleNameProvider.class);
    String key = (type == DISPLAY_VARIANT ? "%%"+code : code);
    String result = pool.getLocalizedObject(
                            LocaleNameGetter.INSTANCE,
                            inLocale, key, type, code);
        if (result != null) {
            return result;
        }

    return code;
}
 
Example #2
Source File: Locale.java    From jdk1.8-source-analysis with Apache License 2.0 6 votes vote down vote up
private String getDisplayString(String code, Locale inLocale, int type) {
    if (code.length() == 0) {
        return "";
    }

    if (inLocale == null) {
        throw new NullPointerException();
    }

    LocaleServiceProviderPool pool =
        LocaleServiceProviderPool.getPool(LocaleNameProvider.class);
    String key = (type == DISPLAY_VARIANT ? "%%"+code : code);
    String result = pool.getLocalizedObject(
                            LocaleNameGetter.INSTANCE,
                            inLocale, key, type, code);
        if (result != null) {
            return result;
        }

    return code;
}
 
Example #3
Source File: Locale.java    From openjdk-8 with GNU General Public License v2.0 6 votes vote down vote up
private String getDisplayString(String code, Locale inLocale, int type) {
    if (code.length() == 0) {
        return "";
    }

    if (inLocale == null) {
        throw new NullPointerException();
    }

    LocaleServiceProviderPool pool =
        LocaleServiceProviderPool.getPool(LocaleNameProvider.class);
    String key = (type == DISPLAY_VARIANT ? "%%"+code : code);
    String result = pool.getLocalizedObject(
                            LocaleNameGetter.INSTANCE,
                            inLocale, key, type, code);
        if (result != null) {
            return result;
        }

    return code;
}
 
Example #4
Source File: Locale.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 6 votes vote down vote up
private String getDisplayString(String code, Locale inLocale, int type) {
    if (code.length() == 0) {
        return "";
    }

    if (inLocale == null) {
        throw new NullPointerException();
    }

    LocaleServiceProviderPool pool =
        LocaleServiceProviderPool.getPool(LocaleNameProvider.class);
    String key = (type == DISPLAY_VARIANT ? "%%"+code : code);
    String result = pool.getLocalizedObject(
                            LocaleNameGetter.INSTANCE,
                            inLocale, key, type, code);
        if (result != null) {
            return result;
        }

    return code;
}
 
Example #5
Source File: Locale.java    From hottub with GNU General Public License v2.0 6 votes vote down vote up
private String getDisplayString(String code, Locale inLocale, int type) {
    if (code.length() == 0) {
        return "";
    }

    if (inLocale == null) {
        throw new NullPointerException();
    }

    LocaleServiceProviderPool pool =
        LocaleServiceProviderPool.getPool(LocaleNameProvider.class);
    String key = (type == DISPLAY_VARIANT ? "%%"+code : code);
    String result = pool.getLocalizedObject(
                            LocaleNameGetter.INSTANCE,
                            inLocale, key, type, code);
        if (result != null) {
            return result;
        }

    return code;
}
 
Example #6
Source File: Locale.java    From openjdk-jdk8u with GNU General Public License v2.0 6 votes vote down vote up
private String getDisplayString(String code, Locale inLocale, int type) {
    if (code.length() == 0) {
        return "";
    }

    if (inLocale == null) {
        throw new NullPointerException();
    }

    LocaleServiceProviderPool pool =
        LocaleServiceProviderPool.getPool(LocaleNameProvider.class);
    String key = (type == DISPLAY_VARIANT ? "%%"+code : code);
    String result = pool.getLocalizedObject(
                            LocaleNameGetter.INSTANCE,
                            inLocale, key, type, code);
        if (result != null) {
            return result;
        }

    return code;
}
 
Example #7
Source File: Locale.java    From TencentKona-8 with GNU General Public License v2.0 6 votes vote down vote up
private String getDisplayString(String code, Locale inLocale, int type) {
    if (code.length() == 0) {
        return "";
    }

    if (inLocale == null) {
        throw new NullPointerException();
    }

    LocaleServiceProviderPool pool =
        LocaleServiceProviderPool.getPool(LocaleNameProvider.class);
    String key = (type == DISPLAY_VARIANT ? "%%"+code : code);
    String result = pool.getLocalizedObject(
                            LocaleNameGetter.INSTANCE,
                            inLocale, key, type, code);
        if (result != null) {
            return result;
        }

    return code;
}
 
Example #8
Source File: Locale.java    From dragonwell8_jdk with GNU General Public License v2.0 6 votes vote down vote up
private String getDisplayString(String code, Locale inLocale, int type) {
    if (code.length() == 0) {
        return "";
    }

    if (inLocale == null) {
        throw new NullPointerException();
    }

    LocaleServiceProviderPool pool =
        LocaleServiceProviderPool.getPool(LocaleNameProvider.class);
    String key = (type == DISPLAY_VARIANT ? "%%"+code : code);
    String result = pool.getLocalizedObject(
                            LocaleNameGetter.INSTANCE,
                            inLocale, key, type, code);
        if (result != null) {
            return result;
        }

    return code;
}
 
Example #9
Source File: Locale.java    From jdk8u-jdk with GNU General Public License v2.0 6 votes vote down vote up
private String getDisplayString(String code, Locale inLocale, int type) {
    if (code.length() == 0) {
        return "";
    }

    if (inLocale == null) {
        throw new NullPointerException();
    }

    LocaleServiceProviderPool pool =
        LocaleServiceProviderPool.getPool(LocaleNameProvider.class);
    String key = (type == DISPLAY_VARIANT ? "%%"+code : code);
    String result = pool.getLocalizedObject(
                            LocaleNameGetter.INSTANCE,
                            inLocale, key, type, code);
        if (result != null) {
            return result;
        }

    return code;
}
 
Example #10
Source File: Locale.java    From Bytecoder with Apache License 2.0 6 votes vote down vote up
private String getDisplayString(String code, String cat, Locale inLocale, int type) {
    Objects.requireNonNull(inLocale);
    Objects.requireNonNull(code);

    if (code.isEmpty()) {
        return "";
    }

    LocaleServiceProviderPool pool =
        LocaleServiceProviderPool.getPool(LocaleNameProvider.class);
    String rbKey = (type == DISPLAY_VARIANT ? "%%"+code : code);
    String result = pool.getLocalizedObject(
                            LocaleNameGetter.INSTANCE,
                            inLocale, rbKey, type, code, cat);
    return result != null ? result : code;
}
 
Example #11
Source File: Locale.java    From jdk8u60 with GNU General Public License v2.0 6 votes vote down vote up
private String getDisplayString(String code, Locale inLocale, int type) {
    if (code.length() == 0) {
        return "";
    }

    if (inLocale == null) {
        throw new NullPointerException();
    }

    LocaleServiceProviderPool pool =
        LocaleServiceProviderPool.getPool(LocaleNameProvider.class);
    String key = (type == DISPLAY_VARIANT ? "%%"+code : code);
    String result = pool.getLocalizedObject(
                            LocaleNameGetter.INSTANCE,
                            inLocale, key, type, code);
        if (result != null) {
            return result;
        }

    return code;
}
 
Example #12
Source File: Bug6989440.java    From openjdk-8 with GNU General Public License v2.0 5 votes vote down vote up
public void run() {
    try {
        LocaleServiceProviderPool pool = LocaleServiceProviderPool.getPool(cls);
        pool.getAvailableLocales();
    } catch (Exception e) {
        System.out.println(e);
        e.printStackTrace();
        failed = true;
    }
}
 
Example #13
Source File: Currency.java    From openjdk-8 with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Gets the name that is suitable for displaying this currency for
 * the specified locale.  If there is no suitable display name found
 * for the specified locale, the ISO 4217 currency code is returned.
 *
 * @param locale the locale for which a display name for this currency is
 * needed
 * @return the display name of this currency for the specified locale
 * @exception NullPointerException if <code>locale</code> is null
 * @since 1.7
 */
public String getDisplayName(Locale locale) {
    LocaleServiceProviderPool pool =
        LocaleServiceProviderPool.getPool(CurrencyNameProvider.class);
    String result = pool.getLocalizedObject(
                            CurrencyNameGetter.INSTANCE,
                            locale, currencyCode, DISPLAYNAME);
    if (result != null) {
        return result;
    }

    // use currency code as symbol of last resort
    return currencyCode;
}
 
Example #14
Source File: Currency.java    From dragonwell8_jdk with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Gets the name that is suitable for displaying this currency for
 * the specified locale.  If there is no suitable display name found
 * for the specified locale, the ISO 4217 currency code is returned.
 *
 * @param locale the locale for which a display name for this currency is
 * needed
 * @return the display name of this currency for the specified locale
 * @exception NullPointerException if <code>locale</code> is null
 * @since 1.7
 */
public String getDisplayName(Locale locale) {
    LocaleServiceProviderPool pool =
        LocaleServiceProviderPool.getPool(CurrencyNameProvider.class);
    String result = pool.getLocalizedObject(
                            CurrencyNameGetter.INSTANCE,
                            locale, currencyCode, DISPLAYNAME);
    if (result != null) {
        return result;
    }

    // use currency code as symbol of last resort
    return currencyCode;
}
 
Example #15
Source File: Currency.java    From jdk8u-jdk with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Gets the symbol of this currency for the specified locale.
 * For example, for the US Dollar, the symbol is "$" if the specified
 * locale is the US, while for other locales it may be "US$". If no
 * symbol can be determined, the ISO 4217 currency code is returned.
 *
 * @param locale the locale for which a display name for this currency is
 * needed
 * @return the symbol of this currency for the specified locale
 * @exception NullPointerException if <code>locale</code> is null
 */
public String getSymbol(Locale locale) {
    LocaleServiceProviderPool pool =
        LocaleServiceProviderPool.getPool(CurrencyNameProvider.class);
    String symbol = pool.getLocalizedObject(
                            CurrencyNameGetter.INSTANCE,
                            locale, currencyCode, SYMBOL);
    if (symbol != null) {
        return symbol;
    }

    // use currency code as symbol of last resort
    return currencyCode;
}
 
Example #16
Source File: Currency.java    From hottub with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Gets the symbol of this currency for the specified locale.
 * For example, for the US Dollar, the symbol is "$" if the specified
 * locale is the US, while for other locales it may be "US$". If no
 * symbol can be determined, the ISO 4217 currency code is returned.
 *
 * @param locale the locale for which a display name for this currency is
 * needed
 * @return the symbol of this currency for the specified locale
 * @exception NullPointerException if <code>locale</code> is null
 */
public String getSymbol(Locale locale) {
    LocaleServiceProviderPool pool =
        LocaleServiceProviderPool.getPool(CurrencyNameProvider.class);
    String symbol = pool.getLocalizedObject(
                            CurrencyNameGetter.INSTANCE,
                            locale, currencyCode, SYMBOL);
    if (symbol != null) {
        return symbol;
    }

    // use currency code as symbol of last resort
    return currencyCode;
}
 
Example #17
Source File: Currency.java    From Java8CN with Apache License 2.0 5 votes vote down vote up
/**
 * Gets the name that is suitable for displaying this currency for
 * the specified locale.  If there is no suitable display name found
 * for the specified locale, the ISO 4217 currency code is returned.
 *
 * @param locale the locale for which a display name for this currency is
 * needed
 * @return the display name of this currency for the specified locale
 * @exception NullPointerException if <code>locale</code> is null
 * @since 1.7
 */
public String getDisplayName(Locale locale) {
    LocaleServiceProviderPool pool =
        LocaleServiceProviderPool.getPool(CurrencyNameProvider.class);
    String result = pool.getLocalizedObject(
                            CurrencyNameGetter.INSTANCE,
                            locale, currencyCode, DISPLAYNAME);
    if (result != null) {
        return result;
    }

    // use currency code as symbol of last resort
    return currencyCode;
}
 
Example #18
Source File: Bug6989440.java    From jdk8u-jdk with GNU General Public License v2.0 5 votes vote down vote up
public void run() {
    try {
        LocaleServiceProviderPool pool = LocaleServiceProviderPool.getPool(cls);
        pool.getAvailableLocales();
    } catch (Exception e) {
        System.out.println(e);
        e.printStackTrace();
        failed = true;
    }
}
 
Example #19
Source File: Currency.java    From jdk8u-dev-jdk with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Gets the name that is suitable for displaying this currency for
 * the specified locale.  If there is no suitable display name found
 * for the specified locale, the ISO 4217 currency code is returned.
 *
 * @param locale the locale for which a display name for this currency is
 * needed
 * @return the display name of this currency for the specified locale
 * @exception NullPointerException if <code>locale</code> is null
 * @since 1.7
 */
public String getDisplayName(Locale locale) {
    LocaleServiceProviderPool pool =
        LocaleServiceProviderPool.getPool(CurrencyNameProvider.class);
    String result = pool.getLocalizedObject(
                            CurrencyNameGetter.INSTANCE,
                            locale, currencyCode, DISPLAYNAME);
    if (result != null) {
        return result;
    }

    // use currency code as symbol of last resort
    return currencyCode;
}
 
Example #20
Source File: Currency.java    From openjdk-8 with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Gets the symbol of this currency for the specified locale.
 * For example, for the US Dollar, the symbol is "$" if the specified
 * locale is the US, while for other locales it may be "US$". If no
 * symbol can be determined, the ISO 4217 currency code is returned.
 *
 * @param locale the locale for which a display name for this currency is
 * needed
 * @return the symbol of this currency for the specified locale
 * @exception NullPointerException if <code>locale</code> is null
 */
public String getSymbol(Locale locale) {
    LocaleServiceProviderPool pool =
        LocaleServiceProviderPool.getPool(CurrencyNameProvider.class);
    String symbol = pool.getLocalizedObject(
                            CurrencyNameGetter.INSTANCE,
                            locale, currencyCode, SYMBOL);
    if (symbol != null) {
        return symbol;
    }

    // use currency code as symbol of last resort
    return currencyCode;
}
 
Example #21
Source File: Currency.java    From jdk1.8-source-analysis with Apache License 2.0 5 votes vote down vote up
/**
 * Gets the symbol of this currency for the specified locale.
 * For example, for the US Dollar, the symbol is "$" if the specified
 * locale is the US, while for other locales it may be "US$". If no
 * symbol can be determined, the ISO 4217 currency code is returned.
 *
 * @param locale the locale for which a display name for this currency is
 * needed
 * @return the symbol of this currency for the specified locale
 * @exception NullPointerException if <code>locale</code> is null
 */
public String getSymbol(Locale locale) {
    LocaleServiceProviderPool pool =
        LocaleServiceProviderPool.getPool(CurrencyNameProvider.class);
    String symbol = pool.getLocalizedObject(
                            CurrencyNameGetter.INSTANCE,
                            locale, currencyCode, SYMBOL);
    if (symbol != null) {
        return symbol;
    }

    // use currency code as symbol of last resort
    return currencyCode;
}
 
Example #22
Source File: Currency.java    From jdk1.8-source-analysis with Apache License 2.0 5 votes vote down vote up
/**
 * Gets the name that is suitable for displaying this currency for
 * the specified locale.  If there is no suitable display name found
 * for the specified locale, the ISO 4217 currency code is returned.
 *
 * @param locale the locale for which a display name for this currency is
 * needed
 * @return the display name of this currency for the specified locale
 * @exception NullPointerException if <code>locale</code> is null
 * @since 1.7
 */
public String getDisplayName(Locale locale) {
    LocaleServiceProviderPool pool =
        LocaleServiceProviderPool.getPool(CurrencyNameProvider.class);
    String result = pool.getLocalizedObject(
                            CurrencyNameGetter.INSTANCE,
                            locale, currencyCode, DISPLAYNAME);
    if (result != null) {
        return result;
    }

    // use currency code as symbol of last resort
    return currencyCode;
}
 
Example #23
Source File: Bug6989440.java    From jdk8u60 with GNU General Public License v2.0 5 votes vote down vote up
public void run() {
    try {
        LocaleServiceProviderPool pool = LocaleServiceProviderPool.getPool(cls);
        pool.getAvailableLocales();
    } catch (Exception e) {
        System.out.println(e);
        e.printStackTrace();
        failed = true;
    }
}
 
Example #24
Source File: Bug6989440.java    From hottub with GNU General Public License v2.0 5 votes vote down vote up
public void run() {
    try {
        LocaleServiceProviderPool pool = LocaleServiceProviderPool.getPool(cls);
        pool.getAvailableLocales();
    } catch (Exception e) {
        System.out.println(e);
        e.printStackTrace();
        failed = true;
    }
}
 
Example #25
Source File: Currency.java    From jdk8u_jdk with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Gets the name that is suitable for displaying this currency for
 * the specified locale.  If there is no suitable display name found
 * for the specified locale, the ISO 4217 currency code is returned.
 *
 * @param locale the locale for which a display name for this currency is
 * needed
 * @return the display name of this currency for the specified locale
 * @exception NullPointerException if <code>locale</code> is null
 * @since 1.7
 */
public String getDisplayName(Locale locale) {
    LocaleServiceProviderPool pool =
        LocaleServiceProviderPool.getPool(CurrencyNameProvider.class);
    String result = pool.getLocalizedObject(
                            CurrencyNameGetter.INSTANCE,
                            locale, currencyCode, DISPLAYNAME);
    if (result != null) {
        return result;
    }

    // use currency code as symbol of last resort
    return currencyCode;
}
 
Example #26
Source File: Currency.java    From Bytecoder with Apache License 2.0 5 votes vote down vote up
/**
 * Gets the name that is suitable for displaying this currency for
 * the specified locale.  If there is no suitable display name found
 * for the specified locale, the ISO 4217 currency code is returned.
 *
 * @param locale the locale for which a display name for this currency is
 * needed
 * @return the display name of this currency for the specified locale
 * @throws    NullPointerException if {@code locale} is null
 * @since 1.7
 */
public String getDisplayName(Locale locale) {
    LocaleServiceProviderPool pool =
        LocaleServiceProviderPool.getPool(CurrencyNameProvider.class);
    String result = pool.getLocalizedObject(
                            CurrencyNameGetter.INSTANCE,
                            locale, currencyCode, DISPLAYNAME);
    if (result != null) {
        return result;
    }

    // use currency code as symbol of last resort
    return currencyCode;
}
 
Example #27
Source File: Currency.java    From jdk8u_jdk with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Gets the symbol of this currency for the specified locale.
 * For example, for the US Dollar, the symbol is "$" if the specified
 * locale is the US, while for other locales it may be "US$". If no
 * symbol can be determined, the ISO 4217 currency code is returned.
 *
 * @param locale the locale for which a display name for this currency is
 * needed
 * @return the symbol of this currency for the specified locale
 * @exception NullPointerException if <code>locale</code> is null
 */
public String getSymbol(Locale locale) {
    LocaleServiceProviderPool pool =
        LocaleServiceProviderPool.getPool(CurrencyNameProvider.class);
    String symbol = pool.getLocalizedObject(
                            CurrencyNameGetter.INSTANCE,
                            locale, currencyCode, SYMBOL);
    if (symbol != null) {
        return symbol;
    }

    // use currency code as symbol of last resort
    return currencyCode;
}
 
Example #28
Source File: Currency.java    From jdk8u-jdk with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Gets the name that is suitable for displaying this currency for
 * the specified locale.  If there is no suitable display name found
 * for the specified locale, the ISO 4217 currency code is returned.
 *
 * @param locale the locale for which a display name for this currency is
 * needed
 * @return the display name of this currency for the specified locale
 * @exception NullPointerException if <code>locale</code> is null
 * @since 1.7
 */
public String getDisplayName(Locale locale) {
    LocaleServiceProviderPool pool =
        LocaleServiceProviderPool.getPool(CurrencyNameProvider.class);
    String result = pool.getLocalizedObject(
                            CurrencyNameGetter.INSTANCE,
                            locale, currencyCode, DISPLAYNAME);
    if (result != null) {
        return result;
    }

    // use currency code as symbol of last resort
    return currencyCode;
}
 
Example #29
Source File: Bug6989440.java    From jdk8u-dev-jdk with GNU General Public License v2.0 5 votes vote down vote up
public void run() {
    try {
        LocaleServiceProviderPool pool = LocaleServiceProviderPool.getPool(cls);
        pool.getAvailableLocales();
    } catch (Exception e) {
        System.out.println(e);
        e.printStackTrace();
        failed = true;
    }
}
 
Example #30
Source File: Currency.java    From JDKSourceCode1.8 with MIT License 5 votes vote down vote up
/**
 * Gets the symbol of this currency for the specified locale.
 * For example, for the US Dollar, the symbol is "$" if the specified
 * locale is the US, while for other locales it may be "US$". If no
 * symbol can be determined, the ISO 4217 currency code is returned.
 *
 * @param locale the locale for which a display name for this currency is
 * needed
 * @return the symbol of this currency for the specified locale
 * @exception NullPointerException if <code>locale</code> is null
 */
public String getSymbol(Locale locale) {
    LocaleServiceProviderPool pool =
        LocaleServiceProviderPool.getPool(CurrencyNameProvider.class);
    String symbol = pool.getLocalizedObject(
                            CurrencyNameGetter.INSTANCE,
                            locale, currencyCode, SYMBOL);
    if (symbol != null) {
        return symbol;
    }

    // use currency code as symbol of last resort
    return currencyCode;
}