Class LanguageRegistry


  • class LanguageRegistry
    extends java.lang.Object
    Class that represents the BCP-47 language registry, with all subtags in lowercase. Generated from "http://www.iana.org/assignments/language-subtag-registry/language-subtag-registry". Private and deprecated tags/subtags are not included.
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      (package private) static java.lang.String getExtlangPrefix​(java.lang.String subtag)
      Gets the prefix tag (in lowercase) for the extlang.
      (package private) static java.util.List<java.lang.String> getVariantPrefixes​(java.lang.String subtag)
      Gets a list of prefix tags (in lowercase) for the variant.
      (package private) static void init()
      Loads the class in the classloader in order to initialize static members.
      (package private) static boolean isExtlangSubtag​(java.lang.String subtag)
      Determines if the extlang subtag exists.
      (package private) static boolean isGrandfatheredTag​(java.lang.String tag)
      Determines if the grandfathered tag exists.
      (package private) static boolean isLanguageSubtag​(java.lang.String subtag)
      Determines if the language subtag exists.
      (package private) static boolean isRegionSubtag​(java.lang.String subtag)
      Determines if the region subtag exists.
      (package private) static boolean isScriptSubtag​(java.lang.String subtag)
      Determines if the script subtag exists.
      (package private) static boolean isVariantSubtag​(java.lang.String subtag)
      Determines if the variant subtag exists.
      • Methods inherited from class java.lang.Object

        clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Method Detail

      • init

        static void init()
        Loads the class in the classloader in order to initialize static members. Call this before using the class in order to avoid a slight performance hit on first use.
      • isLanguageSubtag

        static boolean isLanguageSubtag​(java.lang.String subtag)
        Determines if the language subtag exists.
        Parameters:
        subtag - the language subtag (in lowercase)
        Returns:
        true or false
      • isExtlangSubtag

        static boolean isExtlangSubtag​(java.lang.String subtag)
        Determines if the extlang subtag exists.
        Parameters:
        subtag - the extlang subtag (in lowercase)
        Returns:
        true or false
      • getExtlangPrefix

        static java.lang.String getExtlangPrefix​(java.lang.String subtag)
        Gets the prefix tag (in lowercase) for the extlang.
        Parameters:
        subtag - the extlang subtag (in lowercase)
        Returns:
        the prefix tag (in lowercase)
      • isScriptSubtag

        static boolean isScriptSubtag​(java.lang.String subtag)
        Determines if the script subtag exists.
        Parameters:
        subtag - the script subtag (in lowercase)
        Returns:
        true or false
      • isRegionSubtag

        static boolean isRegionSubtag​(java.lang.String subtag)
        Determines if the region subtag exists.
        Parameters:
        subtag - the region subtag (in lowercase)
        Returns:
        true or false
      • isVariantSubtag

        static boolean isVariantSubtag​(java.lang.String subtag)
        Determines if the variant subtag exists.
        Parameters:
        subtag - the variant subtag (in lowercase)
        Returns:
        true or false
      • getVariantPrefixes

        static java.util.List<java.lang.String> getVariantPrefixes​(java.lang.String subtag)
        Gets a list of prefix tags (in lowercase) for the variant.
        Parameters:
        subtag - the variant subtag (in lowercase)
        Returns:
        the list of prefix tags (in lowercase)
      • isGrandfatheredTag

        static boolean isGrandfatheredTag​(java.lang.String tag)
        Determines if the grandfathered tag exists.
        Parameters:
        tag - the tag (in lowercase)
        Returns:
        true or false