public static final LanguageRegistry PMD
Contains the languages that support PMD and are found on the classpath of the classloader of this class. This can be used as a "default" registry.
public LanguageRegistry(Set<Language> languages)
Create a new registry that contains the given set of languages.
NullPointerException
- If the parameter is null
public static LanguageRegistry singleton(Language l)
Creates a language registry containing a single language. Note that this may be inconvertible to a
LanguageProcessorRegistry
if the language depends on other languages.
public LanguageRegistry getDependenciesOf(Language lang)
Creates a language registry containing the given language and its dependencies, fetched from this language registry or the parameter.
IllegalStateException
- If dependencies cannot be fulfilled.
public static @NonNull LanguageRegistry loadLanguages(ClassLoader classLoader)
Create a new registry by loading the languages registered via
ServiceLoader
on the classpath of the given classloader.
classLoader
- A classloader
public Set<Language> getLanguages()
Returns a set of all the known languages. The ordering of the languages is by terse name.
@Deprecated public static Language getLanguage(String languageName)
Returns a language from its
full name(eg
"Java"
). This is case sensitive.
languageName
- Language name
public @Nullable Language getLanguageById(@Nullable String langId)
Returns a language from its
ID(eg
"java"
). This is case-sensitive.
langId
- Language ID
public @Nullable LanguageVersion getLanguageVersionById(@Nullable String langId, @Nullable String version)
Returns a language version from its
language ID(eg
"java"
). This is case-sensitive.
langId
- Language ID
version
- Version ID
public @Nullable Language getLanguageByFullName(String languageName)
Returns a language from its
full name(eg
"Java"
). This is case sensitive.
languageName
- Language name
@Deprecated public static @Nullable Language findLanguageByTerseName(@Nullable String terseName)
Returns a language from its
terse name(eg
"java"
). This is case sensitive.
terseName
- Language terse name
@Deprecated public static List<Language> findByExtension(String extensionWithoutDot)
Returns all languages that support the given extension.
extensionWithoutDot
- A file extension (without '.' prefix)
public @NonNull String commaSeparatedList(Function<? super Language,String> languageToString)
Formats the set of languages with the given formatter, sort and join everything with commas. Convenience method.
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4