net.sourceforge.pmd.lang
Interface Language

All Known Implementing Classes:
BaseLanguageModule

public interface Language

Interface each Language implementation has to implement. It is used by the LanguageRregistry to access constants and implementation classes in order to provide support for the language.

The following are key components of a Language in PMD:

See Also:
LanguageVersion, LanguageVersionDiscoverer

Field Summary
static String LANGUAGE_MODULES_CLASS_NAMES_PROPERTY
           
 
Method Summary
 LanguageVersion getDefaultVersion()
          Get the current PMD defined default LanguageVersion for this Language.
 List<String> getExtensions()
          Get the list of file extensions associated with this Language.
 String getName()
          Get the full name of this Language.
 Class<?> getRuleChainVisitorClass()
          Get the RuleChainVisitor implementation class used when visiting the AST structure for this Rules for this Language.
 String getShortName()
          Get the short name of this Language.
 String getTerseName()
          Get the terse name of this Language.
 LanguageVersion getVersion(String version)
          Get the LanguageVersion for the version string from this Language.
 List<LanguageVersion> getVersions()
          Gets the list of supported LanguageVersion for this Language.
 boolean hasExtension(String extension)
          Returns whether the given Language handles the given file extension.
 boolean hasVersion(String version)
           
 

Field Detail

LANGUAGE_MODULES_CLASS_NAMES_PROPERTY

static final String LANGUAGE_MODULES_CLASS_NAMES_PROPERTY
See Also:
Constant Field Values
Method Detail

getName

String getName()
Get the full name of this Language. This is generally the name of this Language without the use of acronyms.

Returns:
The full name of this Language.

getShortName

String getShortName()
Get the short name of this Language. This is the commonly used short form of this Language's name, perhaps an acronym.

Returns:
The short name of this Language.

getTerseName

String getTerseName()
Get the terse name of this Language. This is used for Rule configuration.

Returns:
The terse name of this Language.

getExtensions

List<String> getExtensions()
Get the list of file extensions associated with this Language.

Returns:
List of file extensions.

hasExtension

boolean hasExtension(String extension)
Returns whether the given Language handles the given file extension. The comparison is done ignoring case.

Parameters:
extension - A file extension.
Returns:
true if this Language handles this extension, false otherwise.

getRuleChainVisitorClass

Class<?> getRuleChainVisitorClass()
Get the RuleChainVisitor implementation class used when visiting the AST structure for this Rules for this Language.

Returns:
The RuleChainVisitor class.
See Also:
RuleChainVisitor

getVersions

List<LanguageVersion> getVersions()
Gets the list of supported LanguageVersion for this Language.

Returns:
The LanguageVersion for this Language.

hasVersion

boolean hasVersion(String version)

getVersion

LanguageVersion getVersion(String version)
Get the LanguageVersion for the version string from this Language.

Parameters:
version - The language version string.
Returns:
The corresponding LanguageVersion, null if the version string is not recognized.

getDefaultVersion

LanguageVersion getDefaultVersion()
Get the current PMD defined default LanguageVersion 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.

Returns:
The current default LanguageVersion for this Language.


Copyright © 2002-2015 InfoEther. All Rights Reserved.