Enum EI18nSource

java.lang.Object
java.lang.Enum<EI18nSource>
de.xima.fc.mdl.enums.EI18nSource
All Implemented Interfaces:
INamedUiElement, Serializable, Comparable<EI18nSource>

public enum EI18nSource extends Enum<EI18nSource> implements INamedUiElement
Given a default string and a language-specific string, indicates which string should be used. For example, we could always use the default string; or use the language-specific string and fall back to the default if none is found.
Author:
XIMA MEDIA GmbH
  • Enum Constant Details

    • USE_DEFAULT

      public static final EI18nSource USE_DEFAULT
      Do not use a language-specific string, always use the default.
    • CUSTOM_OR_DEFAULT

      public static final EI18nSource CUSTOM_OR_DEFAULT
      Use the language-specific string if one exists, otherwise fall back to the default string.
    • DISABLE

      public static final EI18nSource DISABLE
      Never use a string for a particular language, always use the empty string.
  • Method Details

    • values

      public static EI18nSource[] values()
      Returns an array containing the constants of this enum type, in the order they are declared.
      Returns:
      an array containing the constants of this enum type, in the order they are declared
    • valueOf

      public static EI18nSource valueOf(String name)
      Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)
      Parameters:
      name - the name of the enum constant to be returned.
      Returns:
      the enum constant with the specified name
      Throws:
      IllegalArgumentException - if this enum type has no constant with the specified name
      NullPointerException - if the argument is null
    • getDisplayName

      public String getDisplayName(Locale locale)
      Specified by:
      getDisplayName in interface INamedUiElement
      Returns:
      Wert, der das entsprechende Objekt an Oberfläche repräsentiert (wird i.A. zur Laufzeit ermittelt).
    • isAvailable

      public boolean isAvailable()
      Returns:
      Whether a string is availble for this setting at all. It is false for DISABLE.
    • resolve

      public abstract String resolve(String defaultValue, String i18nValue)
      Given a default string and a language-specific string, return the string that should actually be used, according to this setting.
      Parameters:
      defaultValue - The default string.
      i18nValue - The language-specific string.
      Returns:
      The resolved string, depending on this setting. Never returns null, only the empty string.