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


Java ResourceBundleControlProvider类代码示例

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


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

示例1: current

import java.util.spi.ResourceBundleControlProvider; //导入依赖的package包/类
public Provider current() {
    ClassLoader tccl = Thread.currentThread().getContextClassLoader();
    if (tccl == null) {
        tccl = getSystemClassLoader();
    }
    while (tccl != null) {
        final ResourceBundleControlProvider impl = providers.get(tccl);
        if (impl != null) {
            return new Provider(impl, tccl);
        }
        if (tccl == tccl.getParent()) {
            return null;
        }
        tccl = tccl.getParent();
    }
    return null;
}
 
开发者ID:Talend,项目名称:daikon,代码行数:18,代码来源:ProviderLocator.java

示例2: getDefaultControl

import java.util.spi.ResourceBundleControlProvider; //导入依赖的package包/类
private static Control getDefaultControl(String baseName) {
    if (providers != null) {
        for (ResourceBundleControlProvider provider : providers) {
            Control control = provider.getControl(baseName);
            if (control != null) {
                return control;
            }
        }
    }
    return Control.INSTANCE;
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:12,代码来源:ResourceBundle.java

示例3: getDefaultControl

import java.util.spi.ResourceBundleControlProvider; //导入依赖的package包/类
private static Control getDefaultControl(Class<?> caller, String baseName) {
    if (providers != null && !caller.getModule().isNamed()) {
        for (ResourceBundleControlProvider provider : providers) {
            Control control = provider.getControl(baseName);
            if (control != null) {
                return control;
            }
        }
    }
    return Control.INSTANCE;
}
 
开发者ID:campolake,项目名称:openjdk9,代码行数:12,代码来源:ResourceBundle.java

示例4: Provider

import java.util.spi.ResourceBundleControlProvider; //导入依赖的package包/类
Provider(final ResourceBundleControlProvider provider, final ClassLoader loader) {
    this.provider = provider;
    this.loader = loader;
}
 
开发者ID:Talend,项目名称:daikon,代码行数:5,代码来源:ProviderLocator.java

示例5: getProvider

import java.util.spi.ResourceBundleControlProvider; //导入依赖的package包/类
public ResourceBundleControlProvider getProvider() {
    return provider;
}
 
开发者ID:Talend,项目名称:daikon,代码行数:4,代码来源:ProviderLocator.java

示例6: register

import java.util.spi.ResourceBundleControlProvider; //导入依赖的package包/类
/**
 * @param loader
 * the loader identifying the current context.
 * @param customProvider
 * the bundle control provider to associate with this loader.
 * @return a callback to call when you don't need the custom provider anymore.
 */
public Runnable register(final ClassLoader loader, final ResourceBundleControlProvider customProvider) {
    if (providers.putIfAbsent(loader, customProvider) != null) {
        throw new IllegalArgumentException("A custom ResourceBundleControlProvider is already registered for " + loader);
    }
    return () -> providers.remove(loader, customProvider);
}
 
开发者ID:Talend,项目名称:daikon,代码行数:14,代码来源:ProviderLocator.java


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