Package hudson.model

Class ParameterDefinition

    • Method Detail

      • copyWithDefaultValue

        public ParameterDefinition copyWithDefaultValue​(ParameterValue defaultValue)
        Create a new instance of this parameter definition and use the passed parameter value as the default value.
        Since:
        1.405
      • getType

        @Exported
        public String getType()
      • getName

        @Exported
        @NonNull
        public String getName()
      • getDescription

        @Exported
        @CheckForNull
        public String getDescription()
      • setDescription

        @DataBoundSetter
        public void setDescription​(@CheckForNull
                                   String description)
        Since:
        2.281
      • getFormattedDescription

        @CheckForNull
        public String getFormattedDescription()
        return parameter description, applying the configured MarkupFormatter for jenkins instance.
        Since:
        1.521
      • createValue

        @CheckForNull
        public abstract ParameterValue createValue​(org.kohsuke.stapler.StaplerRequest req,
                                                   net.sf.json.JSONObject jo)
        Create a parameter value from a form submission.

        This method is invoked when the user fills in the parameter values in the HTML form and submits it to the server.

      • createValue

        @CheckForNull
        public abstract ParameterValue createValue​(org.kohsuke.stapler.StaplerRequest req)
        Create a parameter value from a GET with query string. If no value is available in the request, it returns a default value if possible, or null.

        Unlike createValue(StaplerRequest, JSONObject), this method is intended to support the programmatic POST-ing of the build URL. This form is less expressive (as it doesn't support the tree form), but it's more scriptable.

        If a ParameterDefinition can't really support this mode of creating a value, you may just always return null.

        Throws:
        IllegalStateException - If the parameter is deemed required but was missing in the submission.
      • createValue

        @CheckForNull
        public ParameterValue createValue​(CLICommand command,
                                          String value)
                                   throws IOException,
                                          InterruptedException
        Create a parameter value from the string given in the CLI.
        Parameters:
        command - This is the command that got the parameter.
        Throws:
        AbortException - If the CLI processing should be aborted. Hudson will report the error message without stack trace, and then exits this command. Useful for graceful termination.
        RuntimeException - All the other exceptions cause the stack trace to be dumped, and then the command exits with an error code.
        IOException
        InterruptedException
        Since:
        1.334
      • getDefaultParameterValue

        @CheckForNull
        @Exported
        public ParameterValue getDefaultParameterValue()
        Returns default parameter value for this definition.
        Returns:
        default parameter value or null if no defaults are available
        Since:
        1.253
      • isValid

        public boolean isValid​(ParameterValue value)
        Checks whether a given value is valid for this definition.
        Parameters:
        value - The value to validate.
        Returns:
        True if the value is valid for this definition. False if it is invalid.
        Since:
        2.244
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class Object