Package de.jplag

Class LanguageLoader

java.lang.Object
de.jplag.LanguageLoader

public final class LanguageLoader extends Object
This class contains methods to load Languages.
Author:
Dominik Fuchss
  • Method Details

    • getAllAvailableLanguages

      public static Map<String,Language> getAllAvailableLanguages()
      Get all languages that are currently in the classpath. The languages will be cached. Use clearCache() to obtain new instances.
      Returns:
      the languages as unmodifiable map from identifier to language instance.
    • getLanguage

      public static Optional<Language> getLanguage(String identifier)
      Load a language that is currently in the classpath by its short name.
      Parameters:
      identifier - the identifier of the language
      Returns:
      the language or an empty optional if no language has been found.
      See Also:
    • getAllAvailableLanguageIdentifiers

      public static Set<String> getAllAvailableLanguageIdentifiers()
      Get an unmodifiable set of all available languages with their identifiers.
      Returns:
      identifiers of all available languages
      See Also:
    • clearCache

      public static void clearCache()
      Resets the internal cache of all loaded languages