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
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; 
		} 
	} 
 
} 
Full Snippet Info
8
CodeRank
Stop searching for code, let great code find you!  Add Codota to your java IDE
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 
Full Snippet Info
9
CodeRank
Stop searching for code, let great code find you!  Add Codota to your java IDE
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);
	} 
} 
Full Snippet Info
8
CodeRank
Stop searching for code, let great code find you!  Add Codota to your java IDE
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
		} 
	} 
} 
Full Snippet Info
8
CodeRank
Stop searching for code, let great code find you!  Add Codota to your java IDE

Related Java 8 ResourceBundle Questions & Answers:

See Code Examples for Java 8 ResourceBundle Methods: