
hudson.plugins.analysis.tokens.AbstractAnnotationsCountTokenMacro Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of analysis-core Show documentation
Show all versions of analysis-core Show documentation
This plug-in provides utilities for the static code analysis plug-ins.
The newest version!
package hudson.plugins.analysis.tokens;
import hudson.plugins.analysis.core.BuildResult;
import hudson.plugins.analysis.core.ResultAction;
/**
* Provides a token that evaluates to the number of annotations found by a
* plug-in.
*
* @author Ulli Hafner
*/
public class AbstractAnnotationsCountTokenMacro extends AbstractTokenMacro {
/**
* Creates a new instance of {@link AbstractAnnotationsCountTokenMacro}.
* @param tokenName
* the name of the token
* @param resultActions
* associated actions containing the build result
*/
public AbstractAnnotationsCountTokenMacro(final String tokenName,
final Class extends ResultAction extends BuildResult>>... resultActions) {
super(tokenName, resultActions);
}
@Override
protected String evaluate(final BuildResult result) {
return String.valueOf(result.getNumberOfAnnotations());
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy