Code example for ResourceBundle

Methods: getObject

0
    @Override 
    protected Object handleGetObject(String key) {
        if (current == null) {
            setLocale(Locale.getDefault());
        } 
        return current.getObject(key);
    } 
 
    /** 
     * Delegates getString using the resource bundle corresponding to the local 
     * (create one if it doesn't exist). 
     * 
     * @param key 
     * @param locale 
     * @return 
     */ 
    public String getString(String key, Locale locale) {
        ResourceBundle bundle = map.get(locale);
        if (bundle == null) {
            if (cl == null) {
                bundle = ResourceBundle.getBundle("messages", locale);