Class LanguageRegistry


  • public final class LanguageRegistry
    extends net.sourceforge.pmd.internal.LanguageServiceBase<Language>
    Provides access to the registered PMD languages. These are found from the classpath of the ClassLoader of this class.
    • Method Detail

      • getInstance

        @Deprecated
        public static LanguageRegistry getInstance()
        Deprecated.
        Use the static methods instead, will be made private
      • getLanguages

        public static Collection<Language> getLanguages()
        Returns a collection of all the known languages. The ordering of this collection is undefined.
      • getLanguage

        public static Language getLanguage​(String languageName)
        Returns a language from its full name (eg "Java"). This is case sensitive.
        Parameters:
        languageName - Language name
        Returns:
        A language, or null if the name is unknown
      • getDefaultLanguage

        public static Language getDefaultLanguage()
        Returns a "default language" known to the service loader. This is the Java language if available, otherwise an arbitrary one. If no languages are loaded, returns null.
        Returns:
        A language, or null if the name is unknown
      • findLanguageByTerseName

        public static Language findLanguageByTerseName​(String terseName)
        Returns a language from its terse name (eg "java"). This is case sensitive.
        Parameters:
        terseName - Language terse name
        Returns:
        A language, or null if the name is unknown
      • findLanguageVersionByTerseName

        @Deprecated
        public static LanguageVersion findLanguageVersionByTerseName​(String terseNameAndVersion)
        Deprecated.
        This is not useful, will be removed with 7.0.0
      • findByExtension

        public static List<Language> findByExtension​(String extensionWithoutDot)
        Returns all languages that support the given extension.
        Parameters:
        extensionWithoutDot - A file extension (without '.' prefix)
      • findWithRuleSupport

        @Deprecated
        public static List<Language> findWithRuleSupport()
        Deprecated.
        This method will be removed with PMD 7.0.0. Use getLanguages() instead.
        A utility method to find the Languages which have Rule support.
        Returns:
        A List of Languages with Rule support.
      • commaSeparatedTerseNamesForLanguage

        @Deprecated
        public static String commaSeparatedTerseNamesForLanguage​(List<Language> languages)
        Deprecated.
        This is too specific, will be removed with 7.0.0
      • commaSeparatedTerseNamesForLanguageVersion

        @Deprecated
        public static String commaSeparatedTerseNamesForLanguageVersion​(List<LanguageVersion> languageVersions)
        Deprecated.
        This is too specific, will be removed with 7.0.0