@ThreadSafe public final class I18n extends Object implements I18nResource
| Modifier and Type | Method and Description |
|---|---|
static Set<Locale> |
getLocalizationProblemLocales(Class<?> i18nClass)
Note, calling this method will not trigger localization of the supplied internationalization class.
|
static Set<String> |
getLocalizationProblems(Class<?> i18nClass)
Note, calling this method will not trigger localization of the supplied internationalization class.
|
static Set<String> |
getLocalizationProblems(Class<?> i18nClass,
Locale locale)
Note, calling this method will not trigger localization of the supplied internationalization class.
|
boolean |
hasProblem() |
boolean |
hasProblem(Locale locale) |
String |
id() |
static void |
initialize(Class<?> i18nClass)
Initializes the internationalization fields declared on the supplied class.
|
String |
problem() |
String |
problem(Locale locale) |
String |
text(Locale locale,
Object... arguments)
Get the localized text for the supplied locale, replacing the parameters in the text with those supplied.
|
String |
text(Object... arguments)
Get the localized text for the
current (default) locale, replacing the parameters in the text
with those supplied. |
String |
toString() |
public static Set<Locale> getLocalizationProblemLocales(Class<?> i18nClass)
i18nClass - The internalization class for which localization problem locales should be returned.null.public static Set<String> getLocalizationProblems(Class<?> i18nClass)
i18nClass - The internalization class for which localization problems should be returned.null.public static Set<String> getLocalizationProblems(Class<?> i18nClass, Locale locale)
i18nClass - The internalization class for which localization problems should be returned.locale - The locale for which localization problems should be returned. If null, the default locale will
be used.null.public static void initialize(Class<?> i18nClass)
I18n. The supplied class must not be an interface (of course), but has no
restrictions as to what class it may extend or what interfaces it must implement.i18nClass - A class declaring one or more public, static, non-final fields of type I18n.public String id()
public boolean hasProblem()
true if a problem was encountered while localizing this internationalization object to the default
locale.public boolean hasProblem(Locale locale)
locale - The locale for which to check whether a problem was encountered.true if a problem was encountered while localizing this internationalization object to the supplied
locale.public String problem()
null if none was encountered.public String problem(Locale locale)
locale - The locale for which to return the problem.null if none was encountered.public String text(Object... arguments)
current (default) locale, replacing the parameters in the text
with those supplied.text in interface I18nResourcearguments - the arguments for the parameter replacement; may be null or emptypublic String text(Locale locale, Object... arguments)
text in interface I18nResourcelocale - the locale, or null if the current (default) locale should be usedarguments - the arguments for the parameter replacement; may be null or emptyCopyright © 2008–2016 JBoss, a division of Red Hat. All rights reserved.