Java Code Examples for sun.util.locale.provider.LocaleServiceProviderPool#getPool()
The following examples show how to use
sun.util.locale.provider.LocaleServiceProviderPool#getPool() .
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 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 jdk8u-dev-jdk 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-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 4
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 5
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 6
Source File: Bug6989440.java From openjdk-8 with GNU General Public License v2.0 | 5 votes |
public void run() { try { LocaleServiceProviderPool pool = LocaleServiceProviderPool.getPool(cls); pool.getAvailableLocales(); } catch (Exception e) { System.out.println(e); e.printStackTrace(); failed = true; } }
Example 7
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 8
Source File: Currency.java From Bytecoder with Apache License 2.0 | 3 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. * <p> * If the specified {@code locale} contains "rg" (region override) * <a href="./Locale.html#def_locale_extension">Unicode extension</a>, * the symbol returned from this method reflects * the value specified with that extension. * * @param locale the locale for which a display name for this currency is * needed * @return the symbol of this currency for the specified locale * @throws NullPointerException if {@code locale} is null */ public String getSymbol(Locale locale) { LocaleServiceProviderPool pool = LocaleServiceProviderPool.getPool(CurrencyNameProvider.class); locale = CalendarDataUtility.findRegionOverride(locale); 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 9
Source File: BreakIterator.java From jdk8u_jdk with GNU General Public License v2.0 | 3 votes |
/** * Returns an array of all locales for which the * <code>get*Instance</code> methods of this class can return * localized instances. * The returned array represents the union of locales supported by the Java * runtime and by installed * {@link java.text.spi.BreakIteratorProvider BreakIteratorProvider} implementations. * It must contain at least a <code>Locale</code> * instance equal to {@link java.util.Locale#US Locale.US}. * * @return An array of locales for which localized * <code>BreakIterator</code> instances are available. */ public static synchronized Locale[] getAvailableLocales() { LocaleServiceProviderPool pool = LocaleServiceProviderPool.getPool(BreakIteratorProvider.class); return pool.getAvailableLocales(); }
Example 10
Source File: BreakIterator.java From openjdk-jdk8u-backup with GNU General Public License v2.0 | 3 votes |
/** * Returns an array of all locales for which the * <code>get*Instance</code> methods of this class can return * localized instances. * The returned array represents the union of locales supported by the Java * runtime and by installed * {@link java.text.spi.BreakIteratorProvider BreakIteratorProvider} implementations. * It must contain at least a <code>Locale</code> * instance equal to {@link java.util.Locale#US Locale.US}. * * @return An array of locales for which localized * <code>BreakIterator</code> instances are available. */ public static synchronized Locale[] getAvailableLocales() { LocaleServiceProviderPool pool = LocaleServiceProviderPool.getPool(BreakIteratorProvider.class); return pool.getAvailableLocales(); }
Example 11
Source File: DateFormatSymbols.java From jdk8u-jdk with GNU General Public License v2.0 | 2 votes |
/** * Returns an array of all locales for which the * <code>getInstance</code> methods of this class can return * localized instances. * The returned array represents the union of locales supported by the * Java runtime and by installed * {@link java.text.spi.DateFormatSymbolsProvider DateFormatSymbolsProvider} * implementations. It must contain at least a <code>Locale</code> * instance equal to {@link java.util.Locale#US Locale.US}. * * @return An array of locales for which localized * <code>DateFormatSymbols</code> instances are available. * @since 1.6 */ public static Locale[] getAvailableLocales() { LocaleServiceProviderPool pool= LocaleServiceProviderPool.getPool(DateFormatSymbolsProvider.class); return pool.getAvailableLocales(); }
Example 12
Source File: NumberFormat.java From openjdk-jdk8u with GNU General Public License v2.0 | 2 votes |
/** * Returns an array of all locales for which the * <code>get*Instance</code> methods of this class can return * localized instances. * The returned array represents the union of locales supported by the Java * runtime and by installed * {@link java.text.spi.NumberFormatProvider NumberFormatProvider} implementations. * It must contain at least a <code>Locale</code> instance equal to * {@link java.util.Locale#US Locale.US}. * * @return An array of locales for which localized * <code>NumberFormat</code> instances are available. */ public static Locale[] getAvailableLocales() { LocaleServiceProviderPool pool = LocaleServiceProviderPool.getPool(NumberFormatProvider.class); return pool.getAvailableLocales(); }
Example 13
Source File: Collator.java From Java8CN with Apache License 2.0 | 2 votes |
/** * Returns an array of all locales for which the * <code>getInstance</code> methods of this class can return * localized instances. * The returned array represents the union of locales supported * by the Java runtime and by installed * {@link java.text.spi.CollatorProvider CollatorProvider} implementations. * It must contain at least a Locale instance equal to * {@link java.util.Locale#US Locale.US}. * * @return An array of locales for which localized * <code>Collator</code> instances are available. */ public static synchronized Locale[] getAvailableLocales() { LocaleServiceProviderPool pool = LocaleServiceProviderPool.getPool(CollatorProvider.class); return pool.getAvailableLocales(); }
Example 14
Source File: DateFormatSymbols.java From openjdk-jdk8u with GNU General Public License v2.0 | 2 votes |
/** * Returns an array of all locales for which the * <code>getInstance</code> methods of this class can return * localized instances. * The returned array represents the union of locales supported by the * Java runtime and by installed * {@link java.text.spi.DateFormatSymbolsProvider DateFormatSymbolsProvider} * implementations. It must contain at least a <code>Locale</code> * instance equal to {@link java.util.Locale#US Locale.US}. * * @return An array of locales for which localized * <code>DateFormatSymbols</code> instances are available. * @since 1.6 */ public static Locale[] getAvailableLocales() { LocaleServiceProviderPool pool= LocaleServiceProviderPool.getPool(DateFormatSymbolsProvider.class); return pool.getAvailableLocales(); }
Example 15
Source File: NumberFormat.java From openjdk-8 with GNU General Public License v2.0 | 2 votes |
/** * Returns an array of all locales for which the * <code>get*Instance</code> methods of this class can return * localized instances. * The returned array represents the union of locales supported by the Java * runtime and by installed * {@link java.text.spi.NumberFormatProvider NumberFormatProvider} implementations. * It must contain at least a <code>Locale</code> instance equal to * {@link java.util.Locale#US Locale.US}. * * @return An array of locales for which localized * <code>NumberFormat</code> instances are available. */ public static Locale[] getAvailableLocales() { LocaleServiceProviderPool pool = LocaleServiceProviderPool.getPool(NumberFormatProvider.class); return pool.getAvailableLocales(); }
Example 16
Source File: NumberFormat.java From openjdk-jdk8u-backup with GNU General Public License v2.0 | 2 votes |
/** * Returns an array of all locales for which the * <code>get*Instance</code> methods of this class can return * localized instances. * The returned array represents the union of locales supported by the Java * runtime and by installed * {@link java.text.spi.NumberFormatProvider NumberFormatProvider} implementations. * It must contain at least a <code>Locale</code> instance equal to * {@link java.util.Locale#US Locale.US}. * * @return An array of locales for which localized * <code>NumberFormat</code> instances are available. */ public static Locale[] getAvailableLocales() { LocaleServiceProviderPool pool = LocaleServiceProviderPool.getPool(NumberFormatProvider.class); return pool.getAvailableLocales(); }
Example 17
Source File: Collator.java From jdk8u-jdk with GNU General Public License v2.0 | 2 votes |
/** * Returns an array of all locales for which the * <code>getInstance</code> methods of this class can return * localized instances. * The returned array represents the union of locales supported * by the Java runtime and by installed * {@link java.text.spi.CollatorProvider CollatorProvider} implementations. * It must contain at least a Locale instance equal to * {@link java.util.Locale#US Locale.US}. * * @return An array of locales for which localized * <code>Collator</code> instances are available. */ public static synchronized Locale[] getAvailableLocales() { LocaleServiceProviderPool pool = LocaleServiceProviderPool.getPool(CollatorProvider.class); return pool.getAvailableLocales(); }
Example 18
Source File: DecimalFormatSymbols.java From openjdk-jdk9 with GNU General Public License v2.0 | 2 votes |
/** * Returns an array of all locales for which the * <code>getInstance</code> methods of this class can return * localized instances. * The returned array represents the union of locales supported by the Java * runtime and by installed * {@link java.text.spi.DecimalFormatSymbolsProvider DecimalFormatSymbolsProvider} * implementations. It must contain at least a <code>Locale</code> * instance equal to {@link java.util.Locale#US Locale.US}. * * @return an array of locales for which localized * <code>DecimalFormatSymbols</code> instances are available. * @since 1.6 */ public static Locale[] getAvailableLocales() { LocaleServiceProviderPool pool = LocaleServiceProviderPool.getPool(DecimalFormatSymbolsProvider.class); return pool.getAvailableLocales(); }
Example 19
Source File: Collator.java From jdk8u-dev-jdk with GNU General Public License v2.0 | 2 votes |
/** * Returns an array of all locales for which the * <code>getInstance</code> methods of this class can return * localized instances. * The returned array represents the union of locales supported * by the Java runtime and by installed * {@link java.text.spi.CollatorProvider CollatorProvider} implementations. * It must contain at least a Locale instance equal to * {@link java.util.Locale#US Locale.US}. * * @return An array of locales for which localized * <code>Collator</code> instances are available. */ public static synchronized Locale[] getAvailableLocales() { LocaleServiceProviderPool pool = LocaleServiceProviderPool.getPool(CollatorProvider.class); return pool.getAvailableLocales(); }
Example 20
Source File: Collator.java From jdk8u-jdk with GNU General Public License v2.0 | 2 votes |
/** * Returns an array of all locales for which the * <code>getInstance</code> methods of this class can return * localized instances. * The returned array represents the union of locales supported * by the Java runtime and by installed * {@link java.text.spi.CollatorProvider CollatorProvider} implementations. * It must contain at least a Locale instance equal to * {@link java.util.Locale#US Locale.US}. * * @return An array of locales for which localized * <code>Collator</code> instances are available. */ public static synchronized Locale[] getAvailableLocales() { LocaleServiceProviderPool pool = LocaleServiceProviderPool.getPool(CollatorProvider.class); return pool.getAvailableLocales(); }