public class EnumNameLocalizer
extends java.lang.Object
Modifier and Type | Class and Description |
---|---|
static class |
EnumNameLocalizer.Type
Enum of different types of localizations for an Enum value.
|
Modifier and Type | Method and Description |
---|---|
static java.lang.String |
getLocalizedName(java.lang.Enum e)
Look up the localized display string for an enumeration.
|
static java.lang.String |
getLocalizedName(java.lang.Enum e,
EnumNameLocalizer.Type transType)
Look up the localized display string for an enumeration.
|
static java.lang.String[] |
getLocalizedNames(java.lang.Class<? extends java.lang.Enum> clazz,
EnumNameLocalizer.Type transType)
Look up all the localized display strings for all values of an enumeration.
|
static void |
registerEnum(java.lang.Class<? extends java.lang.Enum> clazz,
java.lang.String resourcePrefix)
Register an entire enum class using the specified prefix when building resource names for
localized string lookups.
|
static void |
registerEnum(java.lang.Class<? extends java.lang.Enum> clazz,
java.lang.String resourcePrefix,
EnumNameLocalizer.Type transType)
Register an entire enum class using the specified prefix when building resource names for
localized string lookups.
|
public static void registerEnum(java.lang.Class<? extends java.lang.Enum> clazz, java.lang.String resourcePrefix)
clazz
- Enum class whose elements should have localized Strings loadedresourcePrefix
- String prefix (including any trailing '.') to prefix the Enum values' name() value
for looking up resource Strings (null means use the simple class name plus a '.')Enum.name()
public static void registerEnum(java.lang.Class<? extends java.lang.Enum> clazz, java.lang.String resourcePrefix, EnumNameLocalizer.Type transType)
clazz
- Enum class whose elements should have localized Strings loadedresourcePrefix
- String prefix (including any trailing '.') to prefix the Enum values' name() value
for looking up resource Strings (null means use the simple class name plus a '.')transType
- Type of translation to storeEnum.name()
public static java.lang.String getLocalizedName(java.lang.Enum e)
e
- Enum value to look uppublic static java.lang.String getLocalizedName(java.lang.Enum e, EnumNameLocalizer.Type transType)
e
- Enum value to look uptransType
- Type of translation to look uppublic static java.lang.String[] getLocalizedNames(java.lang.Class<? extends java.lang.Enum> clazz, EnumNameLocalizer.Type transType)
clazz
- Enum class to look up localized namestransType
- Type of translation to look up