• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

Java LocaleServiceProviderPool类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Java中sun.util.locale.provider.LocaleServiceProviderPool的典型用法代码示例。如果您正苦于以下问题:Java LocaleServiceProviderPool类的具体用法?Java LocaleServiceProviderPool怎么用?Java LocaleServiceProviderPool使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



LocaleServiceProviderPool类属于sun.util.locale.provider包,在下文中一共展示了LocaleServiceProviderPool类的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。

示例1: getDisplayString

import sun.util.locale.provider.LocaleServiceProviderPool; //导入依赖的package包/类
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;
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:22,代码来源:Locale.java


示例2: getSymbol

import sun.util.locale.provider.LocaleServiceProviderPool; //导入依赖的package包/类
/**
 * 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;
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:25,代码来源:Currency.java


示例3: getDisplayName

import sun.util.locale.provider.LocaleServiceProviderPool; //导入依赖的package包/类
/**
 * 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;
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:25,代码来源:Currency.java


示例4: run

import sun.util.locale.provider.LocaleServiceProviderPool; //导入依赖的package包/类
public void run() {
    try {
        LocaleServiceProviderPool pool = LocaleServiceProviderPool.getPool(cls);
        pool.getAvailableLocales();
    } catch (Exception e) {
        System.out.println(e);
        e.printStackTrace();
        failed = true;
    }
}
 
开发者ID:lambdalab-mirror,项目名称:jdk8u-jdk,代码行数:11,代码来源:Bug6989440.java


示例5: getAvailableLocales

import sun.util.locale.provider.LocaleServiceProviderPool; //导入依赖的package包/类
/**
 * 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();
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:20,代码来源:BreakIterator.java


示例6: getAvailableLocales

import sun.util.locale.provider.LocaleServiceProviderPool; //导入依赖的package包/类
/**
 * 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.DateFormatProvider DateFormatProvider} 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>DateFormat</code> instances are available.
 */
public static Locale[] getAvailableLocales()
{
    LocaleServiceProviderPool pool =
        LocaleServiceProviderPool.getPool(DateFormatProvider.class);
    return pool.getAvailableLocales();
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:20,代码来源:DateFormat.java



注:本文中的sun.util.locale.provider.LocaleServiceProviderPool类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java JMeterContext类代码示例发布时间:2022-05-22
下一篇:
Java RuntimeUtil类代码示例发布时间:2022-05-22
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap