当前位置: 首页>>代码示例>>Java>>正文


Java InternalLocaleBuilder.getLocaleExtensions方法代码示例

本文整理汇总了Java中sun.util.locale.InternalLocaleBuilder.getLocaleExtensions方法的典型用法代码示例。如果您正苦于以下问题:Java InternalLocaleBuilder.getLocaleExtensions方法的具体用法?Java InternalLocaleBuilder.getLocaleExtensions怎么用?Java InternalLocaleBuilder.getLocaleExtensions使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在sun.util.locale.InternalLocaleBuilder的用法示例。


在下文中一共展示了InternalLocaleBuilder.getLocaleExtensions方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: readObject

import sun.util.locale.InternalLocaleBuilder; //导入方法依赖的package包/类
/**
 * Deserializes this <code>Locale</code>.
 * @param in the <code>ObjectInputStream</code> to read
 * @throws IOException
 * @throws ClassNotFoundException
 * @throws IllformedLocaleException
 * @since 1.7
 */
private void readObject(ObjectInputStream in) throws IOException, ClassNotFoundException {
    ObjectInputStream.GetField fields = in.readFields();
    String language = (String)fields.get("language", "");
    String script = (String)fields.get("script", "");
    String country = (String)fields.get("country", "");
    String variant = (String)fields.get("variant", "");
    String extStr = (String)fields.get("extensions", "");
    baseLocale = BaseLocale.getInstance(convertOldISOCodes(language), script, country, variant);
    if (extStr.length() > 0) {
        try {
            InternalLocaleBuilder bldr = new InternalLocaleBuilder();
            bldr.setExtensions(extStr);
            localeExtensions = bldr.getLocaleExtensions();
        } catch (LocaleSyntaxException e) {
            throw new IllformedLocaleException(e.getMessage());
        }
    } else {
        localeExtensions = null;
    }
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:29,代码来源:Locale.java

示例2: readObject

import sun.util.locale.InternalLocaleBuilder; //导入方法依赖的package包/类
/**
 * Deserializes this <code>Locale</code>.
 * @param in the <code>ObjectInputStream</code> to read
 * @throws IOException
 * @throws ClassNotFoundException
 * @throws IllformdLocaleException
 * @since 1.7
 */
private void readObject(ObjectInputStream in) throws IOException, ClassNotFoundException {
    ObjectInputStream.GetField fields = in.readFields();
    String language = (String)fields.get("language", "");
    String script = (String)fields.get("script", "");
    String country = (String)fields.get("country", "");
    String variant = (String)fields.get("variant", "");
    String extStr = (String)fields.get("extensions", "");
    baseLocale = BaseLocale.getInstance(convertOldISOCodes(language), script, country, variant);
    if (extStr.length() > 0) {
        try {
            InternalLocaleBuilder bldr = new InternalLocaleBuilder();
            bldr.setExtensions(extStr);
            localeExtensions = bldr.getLocaleExtensions();
        } catch (LocaleSyntaxException e) {
            throw new IllformedLocaleException(e.getMessage());
        }
    } else {
        localeExtensions = null;
    }
}
 
开发者ID:ZhaoX,项目名称:jdk-1.7-annotated,代码行数:29,代码来源:Locale.java


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