Class AbstractRestListParameterDefinition

java.lang.Object
hudson.model.ParameterDefinition
hudson.model.SimpleParameterDefinition
io.jenkins.plugins.restlistparam.AbstractRestListParameterDefinition
All Implemented Interfaces:
ExtensionPoint, Describable<ParameterDefinition>, Serializable
Direct Known Subclasses:
RestListParameterDefinition, RestMultiListParameterDefinition

public abstract class AbstractRestListParameterDefinition extends SimpleParameterDefinition
The value source (endpoint, credentials, expressions, filter, order, cache, custom headers, pagination) and the mode flags shared by the REST List and REST Multi List parameters.

The fields keep the names and declaration order they had in RestListParameterDefinition, because XStream writes inherited fields as flat, unqualified elements: this keeps the stored job configuration of existing REST List Parameters unchanged.

See Also:
  • Field Details

  • Constructor Details

  • Method Details

    • getRestEndpoint

      public String getRestEndpoint()
    • getCredentialId

      public String getCredentialId()
    • getMimeType

      public MimeType getMimeType()
    • getValueExpression

      public String getValueExpression()
    • getFilter

      public String getFilter()
    • getDisplayExpression

      public String getDisplayExpression()
    • setDisplayExpression

      @DataBoundSetter public void setDisplayExpression(String displayExpression)
    • setValueOrder

      @DataBoundSetter public void setValueOrder(ValueOrder valueOrder)
    • getValueOrder

      public ValueOrder getValueOrder()
    • setFilter

      @DataBoundSetter public void setFilter(String filter)
    • getCacheTime

      public Integer getCacheTime()
    • setCacheTime

      @DataBoundSetter public void setCacheTime(Integer cacheTime)
    • getDefaultValue

      public String getDefaultValue()
    • setDefaultValue

      @DataBoundSetter public void setDefaultValue(String defaultValue)
    • isAllowEmptyValue

      public boolean isAllowEmptyValue()
    • setAllowEmptyValue

      @DataBoundSetter public void setAllowEmptyValue(boolean allowEmptyValue)
    • isEnableValidation

      public boolean isEnableValidation()
    • setEnableValidation

      @DataBoundSetter public void setEnableValidation(boolean enableValidation)
    • getCustomHeaders

      public List<CustomHeader> getCustomHeaders()
    • setCustomHeaders

      @DataBoundSetter public void setCustomHeaders(List<CustomHeader> customHeaders)
    • getPagination

      public Pagination getPagination()
      Returns:
      How to follow paginated responses, or null to send a single request
    • setPagination

      @DataBoundSetter public void setPagination(Pagination pagination)
    • getErrorMsg

      public String getErrorMsg()
      Returns:
      The error message stored in the job configuration by earlier versions; fetch errors are no longer stored on the definition
    • getCustomValueLabel

      public String getCustomValueLabel()
      Returns:
      The label of the option the build form offers for a typed value, with {0} where the typed text goes; loader.js fills it in
    • getValues

      @Deprecated public List<ValueItem> getValues()
      Returns this parameter's entries, from the value cache while they are fresh, fetching them otherwise. Credentials are resolved against the job of the current Stapler request, if any.
      Returns:
      The entries, or an empty list when fetching failed
    • isDefaultSelected

      public abstract boolean isDefaultSelected(ValueItem item)
      Parameters:
      item - A fetched entry
      Returns:
      Whether the build form preselects the entry because of the default value
    • createLoader

      public ValueLoader createLoader()
      Creates the object the build form loads this parameter's entries through, for the job of the current request.
    • createLoader

      public ValueLoader createLoader(Item item)
      Parameters:
      item - The job the build form belongs to, or null outside any job
      Returns:
      The object the build form loads this parameter's entries through
    • entryValuesFor

      protected Set<String> entryValuesFor(Collection<String> elements)
      The entry values that submitted elements are checked against when validation is enabled. The cached entries are used when they are fresh and contain every element; otherwise the entries are fetched once, bypassing both caches. Stale cached entries are never used.

      Credentials, custom header credentials and the cache key are resolved against the job of the current web request or, without one (Pipeline build step, CLI), against the job holding this definition.

      Parameters:
      elements - The non-empty elements of the submitted value
      Returns:
      The entry values to check against; empty when the fetch failed