|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | ENUM CONSTANTS | FIELD | METHOD | DETAIL: ENUM CONSTANTS | FIELD | METHOD |
java.lang.Objectjava.lang.Enum<Language>
net.sourceforge.pmd.lang.Language
public enum Language
This is an enumeration of the Languages of which PMD is aware. The primary use of a Language is for Rules, but they are also used by utilities such as CPD.
The following are key components of a Language in PMD:
LanguageVersion
,
LanguageVersionDiscoverer
Enum Constant Summary | |
---|---|
CPP
|
|
ECMASCRIPT
|
|
FORTRAN
|
|
JAVA
|
|
JSP
|
|
PHP
|
|
RUBY
|
|
XML
|
|
XSL
|
Method Summary | |
---|---|
static String |
commaSeparatedTerseNames(List<Language> languages)
Return a comma separated list of Language terse names. |
static List<Language> |
findByExtension(String extension)
A utility method to find the Languages which are associated with the given file extension. |
static Language |
findByTerseName(String terseName)
A utility method to find the Language associated with the given terse name, whatever the case is. |
static List<Language> |
findWithRuleSupport()
A utility method to find the Languages which have Rule support. |
static Language |
getDefaultLanguage()
Return the default language for PMD. |
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. |
String |
toString()
A friendly String form of the Language. |
static Language |
valueOf(String name)
Returns the enum constant of this type with the specified name. |
static Language[] |
values()
Returns an array containing the constants of this enum type, in the order they are declared. |
Methods inherited from class java.lang.Enum |
---|
clone, compareTo, equals, finalize, getDeclaringClass, hashCode, name, ordinal, valueOf |
Methods inherited from class java.lang.Object |
---|
getClass, notify, notifyAll, wait, wait, wait |
Enum Constant Detail |
---|
public static final Language CPP
public static final Language FORTRAN
public static final Language ECMASCRIPT
public static final Language JAVA
public static final Language JSP
public static final Language PHP
public static final Language RUBY
public static final Language XSL
public static final Language XML
Method Detail |
---|
public static Language[] values()
for (Language c : Language.values()) System.out.println(c);
public static Language valueOf(String name)
name
- the name of the enum constant to be returned.
IllegalArgumentException
- if this enum type has no constant
with the specified name
NullPointerException
- if the argument is nullpublic String getName()
public String getShortName()
public String getTerseName()
public List<String> getExtensions()
public boolean hasExtension(String extension)
extension
- A file extension.
true
if this Language handles this extension, false
otherwise.public Class<?> getRuleChainVisitorClass()
RuleChainVisitor
public List<LanguageVersion> getVersions()
public LanguageVersion getDefaultVersion()
public LanguageVersion getVersion(String version)
version
- The language version string.
null
if the
version string is not recognized.public String toString()
toString
in class Enum<Language>
public static List<Language> findWithRuleSupport()
public static List<Language> findByExtension(String extension)
extension
- The file extension.
public static Language findByTerseName(String terseName)
terseName
- The Language terse name.
null
if there is
no Language with this terse name.public static String commaSeparatedTerseNames(List<Language> languages)
languages
- The languages.
public static Language getDefaultLanguage()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | ENUM CONSTANTS | FIELD | METHOD | DETAIL: ENUM CONSTANTS | FIELD | METHOD |