Class BuildUrlMacro

  • All Implemented Interfaces:
    hudson.ExtensionPoint

    @Extension
    public class BuildUrlMacro
    extends TokenMacro
    Author:
    Kohsuke Kawaguchi
    • Constructor Detail

      • BuildUrlMacro

        public BuildUrlMacro()
    • Method Detail

      • evaluate

        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
        Description copied from class: TokenMacro
        Evaluates the macro and produces the token.

        Locale

        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().

        Specified by:
        evaluate in class TokenMacro
        Parameters:
        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 accepted
        arguments - 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 because
        argumentMultimap - 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.
        Returns:
        The result of the evaluation. Must not be null.
        Throws:
        MacroEvaluationException - If the evaluation failed, for example because of the parameter error, and that the error message should be presented.
        IOException - Other fatal IOExceptions 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.