Package net.sourceforge.pmd.lang
Class LanguageRegistry
- java.lang.Object
-
- net.sourceforge.pmd.internal.LanguageServiceBase<Language>
-
- net.sourceforge.pmd.lang.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 theClassLoader
of this class.
-
-
Method Summary
All Methods Static Methods Concrete Methods Deprecated Methods Modifier and Type Method Description static String
commaSeparatedTerseNamesForLanguage(List<Language> languages)
Deprecated.This is too specific, will be removed with 7.0.0static String
commaSeparatedTerseNamesForLanguageVersion(List<LanguageVersion> languageVersions)
Deprecated.This is too specific, will be removed with 7.0.0static List<LanguageVersion>
findAllVersions()
Deprecated.This is not useful, will be removed with 7.0.0static List<Language>
findByExtension(String extensionWithoutDot)
Returns all languages that support the given extension.static Language
findLanguageByTerseName(String terseName)
Returns a language from its terse name (eg"java"
).static LanguageVersion
findLanguageVersionByTerseName(String terseNameAndVersion)
Deprecated.This is not useful, will be removed with 7.0.0static List<Language>
findWithRuleSupport()
Deprecated.This method will be removed with PMD 7.0.0.static Language
getDefaultLanguage()
Returns a "default language" known to the service loader.static LanguageRegistry
getInstance()
Deprecated.Use the static methods instead, will be made privatestatic Language
getLanguage(String languageName)
Returns a language from its full name (eg"Java"
).static Collection<Language>
getLanguages()
Returns a collection of all the known languages.
-
-
-
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)
-
findAllVersions
@Deprecated public static List<LanguageVersion> findAllVersions()
Deprecated.This is not useful, will be removed with 7.0.0
-
findWithRuleSupport
@Deprecated public static List<Language> findWithRuleSupport()
Deprecated.This method will be removed with PMD 7.0.0. UsegetLanguages()
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
-
-