com.atlassian.clover.spi.lang.Language Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of clover Show documentation
Show all versions of clover Show documentation
Clover is an award winning code coverage and testing tool for Java and Groovy.
It integrates easily with Maven, Ant, Grails, Eclipse and IntelliJ IDEA
as well as with continuous integration servers such as Bamboo, Jenkins or Hudson.
Note: before Clover 4.0 this artifact was named com.cenqua.clover:clover.
package com.atlassian.clover.spi.lang;
import clover.com.google.common.collect.Sets;
import java.util.Collections;
import java.util.Locale;
import java.util.Set;
/**
* A language that Clover may support.
*/
public interface Language {
/**
* @return the language's name
*/
String getName();
/**
* @return the file extensions supported by the language (e.g. ".java")
*/
Set getFileExtensions();
/**
* @return the language constructs supported by the language
*/
Set getSupportedConstructs();
/**
* Languages supported by Clover out-of-the-box.
*/
public enum Builtin implements Language {
JAVA(".java", LanguageConstruct.Builtin.METHOD, LanguageConstruct.Builtin.BRANCH, LanguageConstruct.Builtin.STATEMENT),
GROOVY(".groovy", LanguageConstruct.Builtin.METHOD, LanguageConstruct.Builtin.BRANCH, LanguageConstruct.Builtin.STATEMENT, LanguageConstruct.Builtin.GROOVY_FIELD_EXPRESSION, LanguageConstruct.Builtin.GROOVY_SAFE_METHOD, LanguageConstruct.Builtin.GROOVY_SAFE_ATTRIBUTE, LanguageConstruct.Builtin.GROOVY_SAFE_PROPERTY);
private final Set extensions;
private final Set constructs;
private Builtin(String extension, LanguageConstruct... constructs) {
this.extensions = Collections.singleton(extension);
this.constructs = Collections.unmodifiableSet(Sets.newHashSet(constructs));
}
@Override
public String getName() {
return name().toLowerCase(Locale.ENGLISH);
}
@Override
public Set getFileExtensions() {
return extensions;
}
@Override
public Set getSupportedConstructs() {
return constructs;
}
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy