Class Language

java.lang.Object
com.teamdev.jxbrowser.spellcheck.Language

public final class Language extends Object
A language for which Chromium can perform spell checking.

This class contains a pre-defined set of languages supported by Chromium, and also allows you to create a new one from the language abbreviation pair.

Since:
7.27
  • Field Details

    • BULGARIAN

      public static final Language BULGARIAN
    • CATALAN

      public static final Language CATALAN
    • CZECH

      public static final Language CZECH
    • DANISH

      public static final Language DANISH
    • DUTCH

      public static final Language DUTCH
    • GERMAN

      public static final Language GERMAN
    • GREEK

      public static final Language GREEK
    • ENGLISH_US

      public static final Language ENGLISH_US
    • ENGLISH_UK

      public static final Language ENGLISH_UK
    • SPANISH_SPAIN

      public static final Language SPANISH_SPAIN
    • ESTONIAN

      public static final Language ESTONIAN
    • PERSIAN

      public static final Language PERSIAN
    • FRENCH

      public static final Language FRENCH
    • HEBREW

      public static final Language HEBREW
    • HINDI

      public static final Language HINDI
    • CROATIAN

      public static final Language CROATIAN
    • HUNGARIAN

      public static final Language HUNGARIAN
    • INDONESIAN

      public static final Language INDONESIAN
    • ITALIAN

      public static final Language ITALIAN
    • KOREAN

      public static final Language KOREAN
    • LITHUANIAN

      public static final Language LITHUANIAN
    • LATVIAN

      public static final Language LATVIAN
    • NORWEGIAN

      public static final Language NORWEGIAN
    • POLISH

      public static final Language POLISH
    • PORTUGUESE_BRAZIL

      public static final Language PORTUGUESE_BRAZIL
    • PORTUGUESE_PORTUGAL

      public static final Language PORTUGUESE_PORTUGAL
    • ROMANIAN

      public static final Language ROMANIAN
    • RUSSIAN

      public static final Language RUSSIAN
    • SLOVAK

      public static final Language SLOVAK
    • SLOVENIAN

      public static final Language SLOVENIAN
    • SERBIAN

      public static final Language SERBIAN
    • SWEDISH

      public static final Language SWEDISH
    • TURKISH

      public static final Language TURKISH
    • UKRAINIAN

      public static final Language UKRAINIAN
    • VIETNAMESE

      public static final Language VIETNAMESE
  • Method Details

    • of

      public static Language of(String code, String region)
      Creates a new Language with the given code and region.

      This method does not check that the constructed Language is a valid language that can be used for spell checking.

      Parameters:
      code - the language code
      region - the region
      Returns:
      a Language with the given code and region.
      Throws:
      IllegalArgumentException - when the given code or region is empty or blank
    • of

      public static Language of(String code)
      Returns a Language with the given code.
      Parameters:
      code - the language code
      Returns:
      a Language with the given code
    • code

      public String code()
      Returns the language code.
    • region

      public Optional<String> region()
      Returns an Optional that contains a string that represents the region or an empty Optional if the region is not specified.
    • toString

      public String toString()
      Returns a string representation of the Language.

      This method returns a string equal to the value of

       <code>-<region>
       
      Overrides:
      toString in class Object
    • equals

      public boolean equals(Object obj)
      Overrides:
      equals in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object