Java Code Examples for sun.util.locale.provider.LocaleServiceProviderPool#getLocalizedObject()
The following examples show how to use
sun.util.locale.provider.LocaleServiceProviderPool#getLocalizedObject() .
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 openjdk-jdk8u-backup with GNU General Public License v2.0 | 6 votes |
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 openjdk-8 with GNU General Public License v2.0 | 6 votes |
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-jdk9 with GNU General Public License v2.0 | 6 votes |
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 hottub with GNU General Public License v2.0 | 6 votes |
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 Bytecoder with Apache License 2.0 | 6 votes |
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 6
Source File: Locale.java From JDKSourceCode1.8 with MIT License | 6 votes |
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: Currency.java From jdk8u60 with GNU General Public License v2.0 | 5 votes |
/** * 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 8
Source File: Currency.java From jdk8u-dev-jdk with GNU General Public License v2.0 | 5 votes |
/** * 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 9
Source File: Currency.java From Java8CN with Apache License 2.0 | 5 votes |
/** * 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 10
Source File: Currency.java From openjdk-8-source with GNU General Public License v2.0 | 5 votes |
/** * 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 11
Source File: Currency.java From jdk8u-jdk with GNU General Public License v2.0 | 5 votes |
/** * 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 12
Source File: Currency.java From JDKSourceCode1.8 with MIT License | 5 votes |
/** * 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 13
Source File: Currency.java From openjdk-8-source with GNU General Public License v2.0 | 5 votes |
/** * 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 hottub with GNU General Public License v2.0 | 5 votes |
/** * 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 TencentKona-8 with GNU General Public License v2.0 | 5 votes |
/** * 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 dragonwell8_jdk with GNU General Public License v2.0 | 5 votes |
/** * 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 17
Source File: Currency.java From jdk8u-dev-jdk with GNU General Public License v2.0 | 5 votes |
/** * 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 18
Source File: Currency.java From openjdk-8 with GNU General Public License v2.0 | 5 votes |
/** * 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 19
Source File: Currency.java From jdk1.8-source-analysis with Apache License 2.0 | 5 votes |
/** * 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 jdk1.8-source-analysis with Apache License 2.0 | 5 votes |
/** * 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; }