Overview | Package | Class | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## org.ka2ddo.yaac.util
Class EnumNameLocalizer

    java.lang.Object
      org.ka2ddo.yaac.util.EnumNameLocalizer

    public class EnumNameLocalizer

extends java.lang.Object

This class provides a generalized mapping of Java enum constants to localized name strings without requiring the enum definitions to know about the source of the localized names.

Method Summary
`static java.lang.String` | `getLocalizedName(java.lang.Enum e)` Look up the localized display string for an enumeration.
`static java.lang.String[]` | `getLocalizedNames(java.lang.Class<? extends java.lang.Enum> clazz)` 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.

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Method Detail

### registerEnum

    public 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.

  Parameters:
    `clazz` - Enum class whose elements should have localized Strings loaded
    `resourcePrefix` - 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 '.')
  See Also:
    `Enum.name()`

### getLocalizedName

    public static java.lang.String getLocalizedName(java.lang.Enum e)

  Look up the localized display string for an enumeration.

  Parameters:
    `e` - Enum value to look up
  Returns:
    localized String display name (if defined in resource bundles), falling back to Enum.name() if not known, or null if null enum value is passed

### getLocalizedNames

    public static java.lang.String[] getLocalizedNames(java.lang.Class<? extends java.lang.Enum> clazz)

  Look up all the localized display strings for all values of an enumeration.

  Parameters:
    `clazz` - Enum class to look up localized names
  Returns:
    localized String display name

Overview | Package | Class | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD