Java 类java.util.spi.ResourceBundleControlProvider 实例源码

项目:daikon    文件:ProviderLocator.java   
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;
}
项目:OpenJSharp    文件:ResourceBundle.java   
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;
}
项目:jdk8u-jdk    文件:ResourceBundle.java   
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;
}
项目:openjdk9    文件:ResourceBundle.java   
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;
}
项目:Java8CN    文件:ResourceBundle.java   
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;
}
项目:jdk8u_jdk    文件:ResourceBundle.java   
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;
}
项目:lookaside_java-1.8.0-openjdk    文件:ResourceBundle.java   
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;
}
项目:infobip-open-jdk-8    文件:ResourceBundle.java   
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;
}
项目:jdk8u-dev-jdk    文件:ResourceBundle.java   
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;
}
项目:OLD-OpenJDK8    文件:ResourceBundle.java   
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;
}
项目:daikon    文件:ProviderLocator.java   
Provider(final ResourceBundleControlProvider provider, final ClassLoader loader) {
    this.provider = provider;
    this.loader = loader;
}
项目:daikon    文件:ProviderLocator.java   
public ResourceBundleControlProvider getProvider() {
    return provider;
}
项目:daikon    文件:ProviderLocator.java   
/**
 * @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);
}