Class Language

java.lang.Object
org.basex.util.ft.Language
All Implemented Interfaces:
Comparable<Language>

public final class Language extends Object implements Comparable<Language>
This class contains language tokens which are valid for the xml:lang attribute. As specified by W3C, the values of the attribute are language identifiers as defined by IETF BCP 47, Tags for the Identification of Languages.
Author:
BaseX Team 2005-21, BSD License, Dimitar Popov, Jens Erat
See Also:
  • Method Details

    • get

      public static Language get(String lang)
      Returns an instance for the specified language code or null.
      Parameters:
      lang - name or code of language
      Returns:
      language code
    • get

      public static Language get(MainOptions opts)
      Returns an instance for the current language option, or English as default language.
      Parameters:
      opts - database options
      Returns:
      language code
    • def

      public static Language def()
      Returns the user language as default language, or English if the language cannot be assigned.
      Returns:
      default language
    • code

      public String code()
      Returns the language code (ISO 639).
      Returns:
      code
    • equals

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

      public int hashCode()
      Overrides:
      hashCode in class Object
    • compareTo

      public int compareTo(Language o)
      Specified by:
      compareTo in interface Comparable<Language>
    • toString

      public String toString()
      Overrides:
      toString in class Object