Java 8 ResourceBundle - top ranked examples from Open Source projects

These code examples were ranked by Codota’s semantic indexing as the best open source examples for Java 8 ResourceBundle class.

This code example shows how to use the following methods:getString
9
CodeRank
Experience pair programming with AI  Get Codota for Java
This code example shows how to use the following methods:containsKey, getString
 
		return value;
	} 
 
	public static String getString(ResourceBundle resourceBundle, String key) {
		if (!resourceBundle.containsKey(key)) {
			return null; 
		} 
 
		try { 
			return resourceBundle.getString(key);
		} 
		catch (MissingResourceException mre) {
			return null; 
		} 
	} 
 
} 
8
CodeRank
Experience pair programming with AI  Get Codota for Java
This code example shows how to use the following methods:getString
 
    @Override 
    public String getResourceAttributeDescription(String attributeName, Locale locale, ResourceBundle bundle) {
        // don't apply the default bundle prefix to these attributes 
        if (sharedAttributeResolver.containsKey(attributeName)) {
            return bundle.getString(getBundleKey(attributeName));
        } 
        return super.getResourceAttributeDescription(attributeName, locale, bundle);
    } 
 
    @Override 
    public String getResourceAttributeValueTypeDescription(String attributeName, Locale locale, ResourceBundle bundle, String... suffixes) {
        // don't apply the default bundle prefix to these attributes 
        if (sharedAttributeResolver.containsKey(attributeName)) {
            return bundle.getString(getVariableBundleKey(attributeName, suffixes));
        } 
        return super.getResourceAttributeValueTypeDescription(attributeName, locale, bundle, suffixes);
    } 
 
    @Override 
9
CodeRank
Experience pair programming with AI  Get Codota for Java
This code example shows how to use the following methods:getString
	public I18nParam(String key) {
	this.key = key;
	} 
 
	public String getKey(ResourceBundle bundle) {
	return bundle.getString(key);
	} 
 
	@Override 
	public String toString() {
	return String.format("i18n(%s)", key);
	} 
} 
8
CodeRank
Experience pair programming with AI  Get Codota for Java
This code example shows how to use the following methods:containsKey, getString
	} 
	 
	/** Return translation from the localized ResourceBundle. */ 
	@Override 
	public String apply(String input) {
		if(res.containsKey(input)) {
			return res.getString(input);  // return translation
		} else { 
			return input;  // return untranslated label
		} 
	} 
} 
8
CodeRank
Experience pair programming with AI  Get Codota for Java
This code example shows how to use the following methods:getString
	} 
 
	@Override 
	protected Object handleGetObject(String key) {
		try { 
			return main.getString(key);
		} catch (MissingResourceException e) {
			try { 
				return fallback.getString(key);
			} catch (MissingResourceException e1) {
				return "???" + key + "???";
			} 
		} 
	} 
 
} 
8
CodeRank
Experience pair programming with AI  Get Codota for Java
This code example shows how to use the following methods:getString
    } 
 
    /** {@inheritDoc} */ 
    @Override 
    public String getResourceDescription(Locale locale, ResourceBundle bundle) {
        return bundle.getString(getBundleKey());
    } 
 
    /** {@inheritDoc} */ 
    @Override 
    public String getResourceAttributeDescription(String attributeName, Locale locale, ResourceBundle bundle) {
        return bundle.getString(getBundleKey(attributeName));
    } 
 
    /** {@inheritDoc} */ 
    @Override 
    public String getResourceAttributeValueTypeDescription(String attributeName, Locale locale, ResourceBundle bundle, String... suffixes) {
        return bundle.getString(getVariableBundleKey(new String[]{attributeName}, suffixes));
    } 
 
9
CodeRank
Experience pair programming with AI  Get Codota for Java
This code example shows how to use the following methods:containsKey, getString
	protected Object handleGetObject(String key) {
		if (key == null) {
			throw new NullPointerException();
		} 
 
		if ((parent != null) && parent.containsKey(key)) {
			return parent.getString(key);
		} 
 
		return _portletInfos.get(key);
	} 
 
	@Override 
	protected Set<String> handleKeySet() {
		return _portletInfos.keySet();
	} 
 
	private final Map<String, String> _portletInfos =
		new HashMap<String, String>();
 
8
CodeRank
Experience pair programming with AI  Get Codota for Java
This code example shows how to use the following methods:getString
	} 
 
	@Override 
	protected Object handleGetObject(String key) {
		try { 
			return delegate.getString(key);
		} catch (MissingResourceException e) {
			return "???" + key + "???";
		} 
	} 
 
} 
8
CodeRank
Experience pair programming with AI  Get Codota for Java
This code example shows how to use the following methods:getString
     * key so that small spelling errors don't cripple the GUI 
     * 
     */ 
    private static final String getString(String key) {
        try { 
  	    String res = rb.getString(key);
	    return res;
        } catch (MissingResourceException e) {
	    System.out.println("Missing resource "+key+", using English.");
	    return key;
        } 
    } 
 
    protected void quit() { 
        if (kdcGui.loginHelpMode) {
            kdcGui.setupLoginNormalListeners();
            kdcGui.realLoginFrame.setCursor(c);
        } 
     
        if (kdcGui.mainHelpMode) {
8
CodeRank
Experience pair programming with AI  Get Codota for Java

Related Java 8 ResourceBundle Questions & Answers:

See Code Examples for Java 8 ResourceBundle Methods: