Example usage for java.util ResourceBundle getObject

List of usage examples for java.util ResourceBundle getObject

Introduction

In this page you can find the example usage for java.util ResourceBundle getObject.

Prototype

public final Object getObject(String key) 

Source Link

Document

Gets an object for the given key from this resource bundle or one of its parents.

Usage

From source file:org.vosao.i18n.VosaoResourceBundle.java

@Override
protected Object handleGetObject(String key) {
    Object result = null;//from   w w  w.jav a2s.  com
    for (ResourceBundle bundle : getResourceBundles()) {
        try {
            result = bundle.getObject(key);
        } catch (MissingResourceException e) {
        }
        if (result != null) {
            return result;
        }
    }
    return "_" + key + "_";
}

From source file:pt.ist.expenditureTrackingSystem.domain.acquisitions.Financer.java

protected String getAllocationIds(final String id, final String key) {
    final ResourceBundle resourceBundle = ResourceBundle.getBundle("resources.AcquisitionResources",
            I18N.getLocale());/* w w w.  j a va 2 s .  com*/
    final StringBuilder stringBuilder = new StringBuilder();
    stringBuilder.append('[');
    stringBuilder.append(resourceBundle.getObject(key));
    stringBuilder.append(' ');
    stringBuilder.append(id == null || id.isEmpty() ? "-" : id);
    stringBuilder.append(']');
    return stringBuilder.toString();
}