JavaScript is disabled on your browser.
net.sourceforge.pmd.lang

Enum Language

  • All Implemented Interfaces:
    Serializable, Comparable<Language>


    public enum Language
    extends 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:

    • Name - Full name of the Language
    • Short name - The common short form of the Language
    • Terse name - The shortest and simplest possible form of the Language name, generally used for Rule configuration
    • Extensions - File extensions associated with the Language
    • Rule Chain Visitor - The RuleChainVisitor implementation used for this Language
    • Versions - The LanguageVersions associated with the Language
    See Also:
    LanguageVersion, LanguageVersionDiscoverer
    • Enum Constant Detail

      • FORTRAN

        public static final Language FORTRAN
      • ECMASCRIPT

        public static final Language ECMASCRIPT
      • JAVA

        public static final Language JAVA
      • PLSQL

        public static final Language PLSQL
      • RUBY

        public static final Language RUBY
    • Method Detail

      • values

        public static Language[] values()
        Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:
        for (Language c : Language.values())
         System.out.println(c);
        
        Returns:
        an array containing the constants of this enum type, in the order they are declared
      • valueOf

        public static Language valueOf(String name)
        Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)
        Parameters:
        name - the name of the enum constant to be returned.
        Returns:
        the enum constant with the specified name
        Throws:
        IllegalArgumentException - if this enum type has no constant with the specified name
        NullPointerException - if the argument is null
      • getName

        public 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

        public 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

        public String getTerseName()
        Get the terse name of this Language. This is used for Rule configuration.
        Returns:
        The terse name of this Language.
      • getExtensions

        public List<String> getExtensions()
        Get the list of file extensions associated with this Language.
        Returns:
        List of file extensions.
      • hasExtension

        public 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

        public 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

        public List<LanguageVersion> getVersions()
        Gets the list of supported LanguageVersion for this Language.
        Returns:
        The LanguageVersion for this Language.
      • getDefaultVersion

        public 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.
      • getVersion

        public 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.
      • findWithRuleSupport

        public static List<Language> findWithRuleSupport()
        A utility method to find the Languages which have Rule support.
        Returns:
        A List of Languages with Rule support.
      • findByExtension

        public static List<Language> findByExtension(String extension)
        A utility method to find the Languages which are associated with the given file extension.
        Parameters:
        extension - The file extension.
        Returns:
        A List of Languages which handle the extension.
      • findByTerseName

        public static Language findByTerseName(String terseName)
        A utility method to find the Language associated with the given terse name, whatever the case is.
        Parameters:
        terseName - The Language terse name.
        Returns:
        The Language with this terse name, null if there is no Language with this terse name.
      • commaSeparatedTerseNames

        public static String commaSeparatedTerseNames(List<Language> languages)
        Return a comma separated list of Language terse names.
        Parameters:
        languages - The languages.
        Returns:
        Comma separated terse names.
      • getDefaultLanguage

        public static Language getDefaultLanguage()
        Return the default language for PMD.
        Returns:
        the proper default language

Copyright © 2002-2014 InfoEther. All Rights Reserved.

AltStyle によって変換されたページ (->オリジナル) /