@Extension public class AdminEmailMacro extends TokenMacro
Modifier and Type | Field and Description |
---|---|
static String |
MACRO_NAME |
Constructor and Description |
---|
AdminEmailMacro() |
Modifier and Type | Method and Description |
---|---|
boolean |
acceptsMacroName(String macroName)
Returns true if this object can evaluate the macro of the given name.
|
String |
evaluate(hudson.model.AbstractBuild<?,?> context,
hudson.model.TaskListener listener,
String macroName,
Map<String,String> arguments,
com.google.common.collect.ListMultimap<String,String> argumentMultimap)
Evaluates the macro and produces the token.
|
String |
evaluate(hudson.model.Run<?,?> run,
hudson.FilePath workspace,
hudson.model.TaskListener listener,
String macroName,
Map<String,String> arguments,
com.google.common.collect.ListMultimap<String,String> argumentMultimap) |
List<String> |
getAcceptedMacroNames() |
String |
getAdminAddress() |
all, expand, expand, expand, expand, expandAll, expandAll, expandAll, expandAll, getAutoCompleteList, getPreviousRun, getWorkspace, hasNestedContent
public static final String MACRO_NAME
public boolean acceptsMacroName(String macroName)
TokenMacro
acceptsMacroName
in class TokenMacro
macroName
- By convention we encourage all caps name.TokenMacro.evaluate(AbstractBuild, TaskListener, String, Map, ListMultimap)
called.public List<String> getAcceptedMacroNames()
getAcceptedMacroNames
in class TokenMacro
public String evaluate(hudson.model.AbstractBuild<?,?> context, hudson.model.TaskListener listener, String macroName, Map<String,String> arguments, com.google.common.collect.ListMultimap<String,String> argumentMultimap) throws MacroEvaluationException, IOException, InterruptedException
TokenMacro
If the token is to produce a human readable text, it should do so by using the implicit locale associated
with the calling thread — see Functions.getCurrentLocale()
.
evaluate
in class TokenMacro
context
- The build object for which this macro is evaluated.listener
- If the progress/status needs to be reported to the build console output, this object can be used.macroName
- The macro name that you acceptedarguments
- Arguments as a map. If multiple values are specified for one key, this will only retain the last one.
This is passed in separately from argumentMultimap
becauseargumentMultimap
- The same arguments, but in a multi-map. If multiple values are specified for one key, all of them
are retained here in the order of appearance. For those macros that support multiple values for the same key
this is more accurate than arguments
, but it's bit more tedious to use.MacroEvaluationException
- If the evaluation failed, for example because of the parameter error, and that the error message
should be presented.IOException
- Other fatal IOException
s that should leave the stack trace in the console.InterruptedException
- If the evaluation involves some remoting operation, user might cancel the build, which results
in an InterruptedException
. Don't catch it, just propagate.public String evaluate(hudson.model.Run<?,?> run, hudson.FilePath workspace, hudson.model.TaskListener listener, String macroName, Map<String,String> arguments, com.google.common.collect.ListMultimap<String,String> argumentMultimap) throws MacroEvaluationException, IOException, InterruptedException
evaluate
in class TokenMacro
MacroEvaluationException
IOException
InterruptedException
@Nonnull public String getAdminAddress() throws MacroEvaluationException
MacroEvaluationException
Copyright © 2016–2018. All rights reserved.