protected String name
protected String shortName
protected String terseName
protected Class<?> ruleChainVisitorClass
protected Map<String,LanguageVersion> versions
protected LanguageVersion defaultVersion
@Deprecated public BaseLanguageModule(String name, String shortName, String terseName, Class<?> ruleChainVisitorClass, String... extensions)
protected void addVersion(String version, LanguageVersionHandler languageVersionHandler, String... versionAliases)
Adds a non-default version with the given identifier.
IllegalArgumentException
- If the string key or any of the aliases conflict with other already recorded versions
protected void addDefaultVersion(String version, LanguageVersionHandler languageVersionHandler, String... versionAliases)
Adds a version with the given identifier, and sets it as the default.
IllegalStateException
- If the default version is already set
IllegalArgumentException
- If the string key or any of the aliases conflict with other already recorded versions
@Deprecated protected void addVersion(String version, LanguageVersionHandler languageVersionHandler, boolean isDefault)
public String getName()Description copied from interface:
Language
Returns the full name of this Language. This is generally the name of this language without the use of acronyms, but possibly some capital letters, eg "Java"
. It's suitable for displaying in a GUI.
public String getShortName()Description copied from interface:
Language
Returns the short name of this language. This is the commonly used short form of this language's name, perhaps an acronym, but possibly with special characters.
getShortName
in interface Language
public String getTerseName()Description copied from interface:
Language
Returns the terse name of this language. This is a short, alphanumeric, lowercase name, eg "java"
. It's used to identify the language in the ruleset XML, and is also in the package name of the language module.
getTerseName
in interface Language
public Class<?> getRuleChainVisitorClass()Description copied from interface:
Language
Get the RuleChainVisitor implementation class used when visiting the AST structure for this Rules for this Language.
getRuleChainVisitorClass
in interface Language
RuleChainVisitor
public List<String> getExtensions()Description copied from interface:
Language
Returns the list of file extensions associated with this language. This list is unmodifiable. Extensions do not have a '.' prefix.
getExtensions
in interface Language
public boolean hasExtension(String extensionWithoutDot)Description copied from interface:
Language
Returns whether this language handles the given file extension. The comparison is done ignoring case.
hasExtension
in interface Language
extensionWithoutDot
- A file extension (without '.' prefix)
true
if this language handles the extension, false
otherwise.
public List<LanguageVersion> getVersions()Description copied from interface:
Language
Returns an ordered list of supported versions for this language.
getVersions
in interface Language
public boolean hasVersion(String version)Description copied from interface:
Language
Returns true if a language version with the given
version stringis registered. Then,
getVersion
will return a non-null value.
hasVersion
in interface Language
version
- A version string
public LanguageVersion getVersion(String versionName)Description copied from interface:
Language
Returns the language version with the given
version string. Returns null if no such version exists.
getVersion
in interface Language
versionName
- A language version string.
null
if the version string is not recognized.
public LanguageVersion getDefaultVersion()Description copied from interface:
Language
Returns the default language version for this language. This is an arbitrary choice made by the PMD product, and can change between PMD releases. Every language has a default version.
getDefaultVersion
in interface Language
public int compareTo(Language o)
compareTo
in interface Comparable<Language>
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