/** * This method takes the key as an argument and * returns the corresponding value reading it * from the Resource Bundle loaded earlier. * * @return value in locale specific language * according to the key passed. */ public Object handleGetObject(String key) { return propResBundle.handleGetObject(key); }
protected Object handleGetObject(String key) { return ((PropertyResourceBundle) rb).handleGetObject(key); }
protected Object handleGetObject(String key) { return ((PropertyResourceBundle) rb).handleGetObject(key); }
protected Object handleGetObject(final String key) { return propertyResourceBundle.get().handleGetObject(key); }
protected Object handleGetObject(String key) { String value = (String) bundle.handleGetObject(key); try { return new String(value.getBytes("ISO-8859-1"), "UTF-8"); } catch (UnsupportedEncodingException e) { // Shouldn't fail - but should we still add logging message? return null; } }
protected Object handleGetObject(String key) { String value = (String) bundle.handleGetObject(key); try { return new String(value.getBytes("ISO-8859-1"), "UTF-8"); } catch (UnsupportedEncodingException e) { // Shouldn't fail - but should we still add logging message? return null; } }
static String getString(String key) { PropertyResourceBundle bundle = null; try { InputStream stream = clazz.getResourceAsStream("properties"); bundle = new PropertyResourceBundle(stream); } catch (Throwable e) { throw new RuntimeException(e); // Chain the exception. } return (String) bundle.handleGetObject(key); } }
static String getString(String key) { PropertyResourceBundle bundle = null; try { InputStream stream = clazz.getResourceAsStream("properties"); bundle = new PropertyResourceBundle(stream); } catch (Throwable e) { throw new RuntimeException(e); // Chain the exception. } return (String) bundle.handleGetObject(key); } }
@Override protected Object handleGetObject( String key ) { String result = ( String )bundle.handleGetObject( key ); try { // We do not buffer the encoded result since the RWT.NLS mechanism // creates and buffers the completely initialized nls instance. So each // entry should only be read once. if( result != null ) { result = new String( result.getBytes( "ISO-8859-1" ), "UTF-8" ); } } catch( UnsupportedEncodingException uee ) { throw new RuntimeException( "should not happen", uee ); } return result; }
/** * This methods reads the value associated with the given key from the * wrapped {@link PropertyResourceBundle} using ISO-8859-1, and returned a * UTF-8 string. * * @param key the key * @return the UTF-8 encoded localized value. * @see java.util.ResourceBundle#handleGetObject(java.lang.String) */ protected Object handleGetObject(String key) { String value = (String) bundle.handleGetObject(key); if (value == null) { return null; } else { // This strange hack let us read UTF-8 characters. return new String(value.getBytes(Charsets.ISO_8859_1), Charsets.UTF_8); } } }
/** * Returns the message string with the specified key from the * "properties" file in the package containing the class with * the specified name. */ protected static final String getString(String className, String key) { PropertyResourceBundle bundle = null; try { InputStream stream = Class.forName(className).getResourceAsStream("properties"); bundle = new PropertyResourceBundle(stream); } catch(Throwable e) { throw new RuntimeException(e); // Chain the exception. } return (String)bundle.handleGetObject(key); } }
/** * Returns the message string with the specified key from the * "properties" file in the package containing the class with * the specified name. */ protected static final String getString(String className, String key) { PropertyResourceBundle bundle = null; try { InputStream stream = Class.forName(className).getResourceAsStream("properties"); bundle = new PropertyResourceBundle(stream); } catch(Throwable e) { throw new RuntimeException(e); // Chain the exception. } return (String)bundle.handleGetObject(key); } }
/** * Returns the message string with the specified key from the * "properties" file in the package containing the class with * the specified name. */ protected static final String getString(String className, String key) { PropertyResourceBundle bundle = null; try { InputStream stream = Class.forName(className).getResourceAsStream("properties"); bundle = new PropertyResourceBundle(stream); } catch(Throwable e) { throw new RuntimeException(e); // Chain the exception. } return (String)bundle.handleGetObject(key); } }
/** * Returns the message string with the specified key from the * "properties" file in the package containing the class with * the specified name. */ protected static final String getString(String className, String key) { PropertyResourceBundle bundle = null; try { InputStream stream = Class.forName(className).getResourceAsStream("properties"); bundle = new PropertyResourceBundle(stream); } catch(Throwable e) { throw new RuntimeException(e); // Chain the exception. } return (String)bundle.handleGetObject(key); } }