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

Enum LanguageVersion

  • All Implemented Interfaces:
    Serializable, Comparable<LanguageVersion>


    public enum LanguageVersion
    extends Enum<LanguageVersion>
    This is an enumeration of the Language versions of which PMD is aware. The primary use of a LanguageVersion is for Rules, but they are also used by utilities such as CPD.

    The following are key components of a LanguageVersion in PMD:

    • Language - The Language with which this version is associated
    • 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
    • Method Detail

      • values

        public static LanguageVersion[] 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 (LanguageVersion c : LanguageVersion.values())
         System.out.println(c);
        
        Returns:
        an array containing the constants of this enum type, in the order they are declared
      • valueOf

        public static LanguageVersion 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
      • getLanguage

        public Language getLanguage()
        Get the Language for this LanguageVersion.
        Returns:
        The Language for this LanguageVersion.
      • getVersion

        public String getVersion()
        Get the version String for this LanguageVersion.
        Returns:
        The version String for this LanguageVersion.
      • getName

        public String getName()
        Get the name of this LanguageVersion. This is Language name appended with the LanguageVersion version if not an empty String.
        Returns:
        The name of this LanguageVersion.
      • getShortName

        public String getShortName()
        Get the short name of this LanguageVersion. This is Language short name appended with the LanguageVersion version if not an empty String.
        Returns:
        The short name of this LanguageVersion.
      • getTerseName

        public String getTerseName()
        Get the terse name of this LanguageVersion. This is Language terse name appended with the LanguageVersion version if not an empty String.
        Returns:
        The terse name of this LanguageVersion.
      • getLanguageVersionHandler

        public LanguageVersionHandler getLanguageVersionHandler()
        Get the LanguageVersionHandler for this LanguageVersion.
        Returns:
        The LanguageVersionHandler for this LanguageVersion.
      • isDefaultVersion

        public boolean isDefaultVersion()
        Returns if this LanguageVersion is the default version for the Language.
        Returns:
        true if this is the default version for the Language, false otherwise.
      • findByTerseName

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

        public static List<LanguageVersion> findVersionsForLanguageTerseName(String languageTerseName)
        A utility method to find the all version associated with the given terse name.
        Parameters:
        languageTerseName - The LanguageVersion terse name.
        Returns:
        A list of versions associated with the terse name.
      • findVersionsForLanguageTerseName

        public static LanguageVersion findVersionsForLanguageTerseName(String languageTerseName,
         String languageVersion)
        A utility method to retrieve the appropriate enum, given the provided parameters
        Parameters:
        languageTerseName - The LanguageVersion terse name.
        languageVersion - The version of the language requested.
        Returns:
        A list of versions associated with the terse name.
      • commaSeparatedTerseNames

        public static String commaSeparatedTerseNames(List<LanguageVersion> languageVersions)
        Return a comma-separated list of LanguageVersion terse names.
        Parameters:
        languageVersions - The language versions.
        Returns:
        Comma-separated terse names.
      • getDefaultVersion

        public static LanguageVersion getDefaultVersion()
        Return the default version for PMD.
        Returns:
        the proper instance of LanguageVersion

Copyright © 2002-2014 InfoEther. All Rights Reserved.

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