hudson.plugins.analysis.tokens
Class AbstractTokenMacro

java.lang.Object
  extended by org.jenkinsci.plugins.tokenmacro.TokenMacro
      extended by org.jenkinsci.plugins.tokenmacro.DataBoundTokenMacro
          extended by hudson.plugins.analysis.tokens.AbstractTokenMacro
All Implemented Interfaces:
hudson.ExtensionPoint
Direct Known Subclasses:
AbstractAnnotationsCountTokenMacro, AbstractFixedAnnotationsTokenMacro, AbstractNewAnnotationsTokenMacro, AbstractResultTokenMacro

public abstract class AbstractTokenMacro
extends org.jenkinsci.plugins.tokenmacro.DataBoundTokenMacro

Provides a token that evaluates to the plug-in build result.

Author:
Ulli Hafner

Nested Class Summary
 
Nested classes/interfaces inherited from class org.jenkinsci.plugins.tokenmacro.DataBoundTokenMacro
org.jenkinsci.plugins.tokenmacro.DataBoundTokenMacro.Parameter
 
Nested classes/interfaces inherited from interface hudson.ExtensionPoint
hudson.ExtensionPoint.LegacyInstancesAreScopedToHudson
 
Constructor Summary
AbstractTokenMacro(String tokenName, Class<? extends ResultAction<? extends BuildResult>>... resultActions)
          Creates a new instance of AbstractTokenMacro.
 
Method Summary
 boolean acceptsMacroName(String macroName)
           
 String evaluate(hudson.model.AbstractBuild<?,?> context, hudson.model.TaskListener listener, String macroName)
           
protected abstract  String evaluate(BuildResult result)
          Evaluates the build result and returns the string value of the token.
 
Methods inherited from class org.jenkinsci.plugins.tokenmacro.DataBoundTokenMacro
evaluate
 
Methods inherited from class org.jenkinsci.plugins.tokenmacro.TokenMacro
all, expand, expandAll, hasNestedContent
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AbstractTokenMacro

public AbstractTokenMacro(String tokenName,
                          Class<? extends ResultAction<? extends BuildResult>>... resultActions)
Creates a new instance of AbstractTokenMacro.

Parameters:
tokenName - the name of the token
resultActions - associated action types containing the build result
Method Detail

evaluate

public String evaluate(hudson.model.AbstractBuild<?,?> context,
                       hudson.model.TaskListener listener,
                       String macroName)
                throws org.jenkinsci.plugins.tokenmacro.MacroEvaluationException,
                       IOException,
                       InterruptedException
Specified by:
evaluate in class org.jenkinsci.plugins.tokenmacro.DataBoundTokenMacro
Throws:
org.jenkinsci.plugins.tokenmacro.MacroEvaluationException
IOException
InterruptedException

evaluate

protected abstract String evaluate(BuildResult result)
Evaluates the build result and returns the string value of the token.

Parameters:
result - the result to evaluate
Returns:
the string value of the token

acceptsMacroName

public boolean acceptsMacroName(String macroName)
Specified by:
acceptsMacroName in class org.jenkinsci.plugins.tokenmacro.TokenMacro


Copyright © 2004-2012 Hudson. All Rights Reserved.