Package io.jenkins.plugins.restlistparam
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
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:
-
Nested Class Summary
Nested classes/interfaces inherited from class hudson.model.ParameterDefinition
ParameterDefinition.ParameterDescriptorNested classes/interfaces inherited from interface hudson.ExtensionPoint
ExtensionPoint.LegacyInstancesAreScopedToHudson -
Field Summary
FieldsFields inherited from class hudson.model.ParameterDefinition
LIST -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedAbstractRestListParameterDefinition(String name, String description, String restEndpoint, String credentialId, MimeType mimeType, String valueExpression, String displayExpression, ValueOrder valueOrder, String filter, Integer cacheTime, String defaultValue, boolean allowEmptyValue, boolean enableValidation, List<ValueItem> values, List<CustomHeader> customHeaders) -
Method Summary
Modifier and TypeMethodDescriptionCreates the object the build form loads this parameter's entries through, for the job of the current request.createLoader(Item item) entryValuesFor(Collection<String> elements) The entry values that submitted elements are checked against when validation is enabled.Deprecated.booleanabstract booleanisDefaultSelected(ValueItem item) booleanvoidsetAllowEmptyValue(boolean allowEmptyValue) voidsetCacheTime(Integer cacheTime) voidsetCustomHeaders(List<CustomHeader> customHeaders) voidsetDefaultValue(String defaultValue) voidsetDisplayExpression(String displayExpression) voidsetEnableValidation(boolean enableValidation) voidvoidsetPagination(Pagination pagination) voidsetValueOrder(ValueOrder valueOrder) Methods inherited from class hudson.model.SimpleParameterDefinition
createValue, createValue, createValueMethods inherited from class hudson.model.ParameterDefinition
all, copyWithDefaultValue, createValue, createValue, createValue, equals, getDefaultParameterValue, getDescription, getDescriptor, getFormattedDescription, getName, getType, hashCode, isValid, setDescription
-
Field Details
-
config
-
-
Constructor Details
-
AbstractRestListParameterDefinition
protected AbstractRestListParameterDefinition(String name, String description, String restEndpoint, String credentialId, MimeType mimeType, String valueExpression, String displayExpression, ValueOrder valueOrder, String filter, Integer cacheTime, String defaultValue, boolean allowEmptyValue, boolean enableValidation, List<ValueItem> values, List<CustomHeader> customHeaders)
-
-
Method Details
-
getRestEndpoint
-
getCredentialId
-
getMimeType
-
getValueExpression
-
getFilter
-
getDisplayExpression
-
setDisplayExpression
-
setValueOrder
-
getValueOrder
-
setFilter
-
getCacheTime
-
setCacheTime
-
getDefaultValue
-
setDefaultValue
-
isAllowEmptyValue
public boolean isAllowEmptyValue() -
setAllowEmptyValue
@DataBoundSetter public void setAllowEmptyValue(boolean allowEmptyValue) -
isEnableValidation
public boolean isEnableValidation() -
setEnableValidation
@DataBoundSetter public void setEnableValidation(boolean enableValidation) -
getCustomHeaders
-
setCustomHeaders
-
getPagination
- Returns:
- How to follow paginated responses, or
nullto send a single request
-
setPagination
-
getErrorMsg
- Returns:
- The error message stored in the job configuration by earlier versions; fetch errors are no longer stored on the definition
-
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.UseValueService.entries(AbstractRestListParameterDefinition, Item, boolean), which also returns the errorReturns 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
- Parameters:
item- A fetched entry- Returns:
- Whether the build form preselects the entry because of the default value
-
createLoader
Creates the object the build form loads this parameter's entries through, for the job of the current request. -
createLoader
- Parameters:
item- The job the build form belongs to, ornulloutside any job- Returns:
- The object the build form loads this parameter's entries through
-
entryValuesFor
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
buildstep, 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
-
ValueService.entries(AbstractRestListParameterDefinition, Item, boolean), which also returns the error