/** * Returns the resource bundle identified by the {@link RestResource#messages() @RestResource.messages()} annotation for the specified locale. * * @param locale The resource bundle locale. * @return The resource bundle. Never <jk>null</jk>. */ public MessageBundle getMessages(Locale locale) { return msgs.getBundle(locale); }
/** * Same as {@link #findFirstString(String...)}, but uses the specified locale. * * @param locale The locale of the resource bundle to retrieve message from. * @param keys The list of possible keys. * @return The resolved value, or <jk>null</jk> if no value is found or the resource bundle is missing. */ public String findFirstString(Locale locale, String...keys) { MessageBundle srb = getBundle(locale); return srb.findFirstString(keys); }
/** * Same as {@link #findFirstString(String...)}, but uses the specified locale. * * @param locale The locale of the resource bundle to retrieve message from. * @param keys The list of possible keys. * @return The resolved value, or <jk>null</jk> if no value is found or the resource bundle is missing. */ public String findFirstString(Locale locale, String...keys) { MessageBundle srb = getBundle(locale); return srb.findFirstString(keys); }
/** * Same as {@link #findFirstString(String...)}, but uses the specified locale. * * @param locale The locale of the resource bundle to retrieve message from. * @param keys The list of possible keys. * @return The resolved value, or <jk>null</jk> if no value is found or the resource bundle is missing. */ public String findFirstString(Locale locale, String...keys) { MessageBundle srb = getBundle(locale); return srb.findFirstString(keys); }
/** * Same as {@link #getString(String, Object...)} but allows you to specify the locale. * * @param locale The locale of the resource bundle to retrieve message from. * @param key The resource bundle key. * @param args Optional {@link MessageFormat}-style arguments. * @return * The resolved value. Never <jk>null</jk>. * <js>"{!!key}"</js> if the bundle is missing. * <js>"{!key}"</js> if the key is missing. */ public String getString(Locale locale, String key, Object...args) { if (locale == null) return getString(key, args); return getBundle(locale).getString(key, args); }
/** * Same as {@link #getString(String, Object...)} but allows you to specify the locale. * * @param locale The locale of the resource bundle to retrieve message from. * @param key The resource bundle key. * @param args Optional {@link MessageFormat}-style arguments. * @return * The resolved value. Never <jk>null</jk>. * <js>"{!!key}"</js> if the bundle is missing. * <js>"{!key}"</js> if the key is missing. */ public String getString(Locale locale, String key, Object...args) { if (locale == null) return getString(key, args); return getBundle(locale).getString(key, args); }
/** * Same as {@link #getString(String, Object...)} but allows you to specify the locale. * * @param locale The locale of the resource bundle to retrieve message from. * @param key The resource bundle key. * @param args Optional {@link MessageFormat}-style arguments. * @return * The resolved value. Never <jk>null</jk>. * <js>"{!!key}"</js> if the bundle is missing. * <js>"{!key}"</js> if the key is missing. */ public String getString(Locale locale, String key, Object...args) { if (locale == null) return getString(key, args); return getBundle(locale).getString(key, args); }
return context.getMessages().getBundle(getLocale());
return context.getMessages().getBundle(getLocale());
return context.getMessages().getBundle(getLocale());