de.esprit.appsuite.type

## Enum Language

- java.lang.Object
- - java.lang.Enum<Language>
  - - de.esprit.appsuite.type.Language

- All Implemented Interfaces:
    NlsKey, PersistentName, Renderable, java.io.Serializable, java.lang.Comparable<Language>

      public enum Language
      extends java.lang.Enum<Language>
      implements Renderable, NlsKey, PersistentName

  This enum defines most common languages. All of them have got a flag Icon for rendering.
  Author:
    Rainer Buesch

- - ### Enum Constant Summary

    Enum Constants
    Enum Constant and Description
    `BE`
    `CN`
    `CZ`
    `DE`
    `DK`
    `EG`
    `EN`
    `ES`
    `FI`
    `FR`
    `GR`
    `HU`
    `IL`
    `IT`
    `NL`
    `NO`
    `NONE`
    `PL`
    `PT`
    `RU`
    `SE`
    `TH`
    `TR`
    `US`

  - ### Field Summary

    - ### Fields inherited from interface de.esprit.appsuite.nls.NlsKey

      `SUB_KEY_ACTION, SUB_KEY_COLUMN, SUB_KEY_CONFIRM, SUB_KEY_CONST, SUB_KEY_DBO, SUB_KEY_DEMO, SUB_KEY_ERROR, SUB_KEY_FIELD, SUB_KEY_GUI, SUB_KEY_HELP, SUB_KEY_INFO, SUB_KEY_LABEL, SUB_KEY_MENU, SUB_KEY_MESSAGE, SUB_KEY_MISC, SUB_KEY_STATUS, SUB_KEY_TIP, SUB_KEY_TOOL, SUB_KEY_WINDOW, SUB_KEY_WORKFLOW`

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `static java.util.Locale` | `findBestLocaleFor(java.lang.String languageCode, java.lang.String countryCode)` Finds the best matching Locale constant for the given language and country.
    `static java.util.Locale` | `findBestLocaleForLanguageCode(java.lang.String language)` Finds the best matching Locale constant for the given language.
    `static Language` | `fromPersistentName(java.lang.String languageCode)`
    `static java.util.Set<Language>` | `getAllAvailableValues()` Returns all available Countries sorted by the translated name.
    `java.lang.String` | `getAppKey()` Returns the base prefix of the key
    `static java.util.Set<Language>` | `getAvailableValues(java.util.EnumSet<Language> set)` Returns the Countries of the input set sorted by the translated name.
    `static Language` | `getDefault()` Returns the `Language` constant that matches the default `Locale`
    `java.lang.String` | `getLanguageCode()`
    `static java.util.Comparator` | `getLanguageComparator()`
    `java.lang.String` | `getLanguageName()`
    `java.util.Locale` | `getLocale()`
    `java.lang.String` | `getPersistentName()` Returns the String value to be stored in the database or file.
    `java.awt.Color` | `getRenderColor()`
    `javax.swing.Icon` | `getRenderIcon()`
    `java.lang.String` | `getRenderText()`
    `java.lang.String` | `getSubKey()` Returns the path of the key
    `java.lang.String` | `getText(java.lang.Object... args)` Returns the translated text, which is the value of the translation key as stored in the translation map.
    `boolean` | `isValid()`
    `java.lang.String` | `toString()` Retuns the unique 2-char language code and the translated language name
    `static Language` | `valueOf(java.lang.String name)` Returns the enum constant of this type with the specified name.
    `static Language[]` | `values()` Returns an array containing the constants of this enum type, in the order they are declared.

    - ### Methods inherited from class java.lang.Enum

      `clone, compareTo, equals, finalize, getDeclaringClass, hashCode, name, ordinal, valueOf`

    - ### Methods inherited from class java.lang.Object

      `getClass, notify, notifyAll, wait, wait, wait`

    - ### Methods inherited from interface de.esprit.appsuite.nls.NlsKey

      `name`

- - ### Enum Constant Detail

    - #### NONE

          public static final Language NONE

    - #### US

          public static final Language US

    - #### DE

          public static final Language DE

    - #### EN

          public static final Language EN

    - #### FR

          public static final Language FR

    - #### NL

          public static final Language NL

    - #### RU

          public static final Language RU

    - #### SE

          public static final Language SE

    - #### ES

          public static final Language ES

    - #### BE

          public static final Language BE

    - #### CN

          public static final Language CN

    - #### PL

          public static final Language PL

    - #### FI

          public static final Language FI

    - #### DK

          public static final Language DK

    - #### IT

          public static final Language IT

    - #### NO

          public static final Language NO

    - #### TH

          public static final Language TH

    - #### CZ

          public static final Language CZ

    - #### HU

          public static final Language HU

    - #### PT

          public static final Language PT

    - #### GR

          public static final Language GR

    - #### TR

          public static final Language TR

    - #### IL

          public static final Language IL

    - #### EG

          public static final Language EG

  - ### Method Detail

    - #### values

          public static Language[] values()

      Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:

          for (Language c : Language.values())
              System.out.println(c);

      Returns:
        an array containing the constants of this enum type, in the order they are declared

    - #### valueOf

          public static Language valueOf(java.lang.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:
        `java.lang.IllegalArgumentException` - if this enum type has no constant with the specified name
        `java.lang.NullPointerException` - if the argument is null

    - #### getPersistentName

          public java.lang.String getPersistentName()

      Description copied from interface: `PersistentName`
      Returns the String value to be stored in the database or file. Note that the implementing Enum must also have a static method named fromPersistentName(String). This ensures that the Enum can be instantiated from the String read from database or file.
      Specified by:
        `getPersistentName` in interface `PersistentName`

    - #### getLanguageCode

          public java.lang.String getLanguageCode()

    - #### getLanguageName

          public java.lang.String getLanguageName()

    - #### getAppKey

          public java.lang.String getAppKey()

      Description copied from interface: `NlsKey`
      Returns the base prefix of the key
      Specified by:
        `getAppKey` in interface `NlsKey`

    - #### getSubKey

          public java.lang.String getSubKey()

      Description copied from interface: `NlsKey`
      Returns the path of the key
      Specified by:
        `getSubKey` in interface `NlsKey`

    - #### getText

          public java.lang.String getText(java.lang.Object... args)

      Description copied from interface: `NlsKey`
      Returns the translated text, which is the value of the translation key as stored in the translation map.
      Specified by:
        `getText` in interface `NlsKey`

    - #### getRenderColor

          public java.awt.Color getRenderColor()

      Specified by:
        `getRenderColor` in interface `Renderable`

    - #### getRenderIcon

          public javax.swing.Icon getRenderIcon()

      Specified by:
        `getRenderIcon` in interface `Renderable`

    - #### getRenderText

          public java.lang.String getRenderText()

      Specified by:
        `getRenderText` in interface `Renderable`

    - #### getAllAvailableValues

          public static java.util.Set<Language> getAllAvailableValues()

      Returns all available Countries sorted by the translated name. Does NOT contain the NONE value.

    - #### getAvailableValues

          public static java.util.Set<Language> getAvailableValues(java.util.EnumSet<Language> set)

      Returns the Countries of the input set sorted by the translated name.

    - #### fromPersistentName

          public static Language fromPersistentName(java.lang.String languageCode)

    - #### findBestLocaleFor

          public static java.util.Locale findBestLocaleFor(java.lang.String languageCode,
                                           java.lang.String countryCode)

      Finds the best matching Locale constant for the given language and country. Returns Locale.ENGLISH if no direct match was found.

    - #### findBestLocaleForLanguageCode

          public static java.util.Locale findBestLocaleForLanguageCode(java.lang.String language)

      Finds the best matching Locale constant for the given language. Returns Locale.ENGLISH if no direct match was found.

    - #### getLocale

          public java.util.Locale getLocale()

    - #### toString

          public java.lang.String toString()

      Retuns the unique 2-char language code and the translated language name
      Overrides:
        `toString` in class `java.lang.Enum<Language>`

    - #### getLanguageComparator

          public static java.util.Comparator getLanguageComparator()

    - #### getDefault

          public static Language getDefault()

      Returns the `Language` constant that matches the default `Locale`

    - #### isValid

          public boolean isValid()

Copyright © 2014 EsprIT-Systems. All Rights Reserved.