Class ChoiceListProvider
java.lang.Object
hudson.model.AbstractDescribableImpl<ChoiceListProvider>
jp.ikedam.jenkins.plugins.extensible_choice_parameter.ChoiceListProvider
- All Implemented Interfaces:
ExtensionPoint
,Describable<ChoiceListProvider>
,Serializable
- Direct Known Subclasses:
AddEditedChoiceListProvider
,FilenameChoiceListProvider
,SystemGroovyChoiceListProvider
public abstract class ChoiceListProvider
extends AbstractDescribableImpl<ChoiceListProvider>
implements ExtensionPoint, Serializable
The abstract base class of modules provides choices.
Create a new choice provider in following steps:
- Define a new class derived from ChoiceListProvider
- Override getChoiceList(), which returns the choices.
- Define the internal public static class named DescriptorImpl, derived from Descriptor<ChoiceListProvider>
- annotate the DescriptorImpl with Extension
- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from interface hudson.ExtensionPoint
ExtensionPoint.LegacyInstancesAreScopedToHudson
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionall()
Returns all the ChoiceListProvider subclass whose DescriptorImpl is annotated with Extension.Returns the choices.Returns the default choice value.void
onBuildCompletedWithValue
(AbstractBuild<?, ?> build, ExtensibleChoiceParameterDefinition def, String value) Called when a build is completed Implementations can override this method, and do custom behavior.void
onBuildTriggeredWithValue
(AbstractProject<?, ?> job, ExtensibleChoiceParameterDefinition def, String value) Called when a build is triggered Implementations can override this method, and do custom behavior.boolean
Checks if accessgetChoiceList()
from REST API needs theItem.BUILD
permission.Methods inherited from class hudson.model.AbstractDescribableImpl
getDescriptor
-
Constructor Details
-
ChoiceListProvider
public ChoiceListProvider()
-
-
Method Details
-
getChoiceList
Returns the choices.- Returns:
- the choices list.
-
getDefaultChoice
Returns the default choice value. null indicates the first one is the default value.- Returns:
- the default choice value.
-
onBuildTriggeredWithValue
public void onBuildTriggeredWithValue(AbstractProject<?, ?> job, ExtensibleChoiceParameterDefinition def, String value) Called when a build is triggered Implementations can override this method, and do custom behavior. Default implementation do nothing at all.- Parameters:
job
- the job with which this choice provider is used.def
- the parameter definition the value specifiedvalue
- the value specified.
-
onBuildCompletedWithValue
public void onBuildCompletedWithValue(AbstractBuild<?, ?> build, ExtensibleChoiceParameterDefinition def, String value) Called when a build is completed Implementations can override this method, and do custom behavior. Default implementation do nothing at all.- Parameters:
build
- the build with which this choice provider is used.def
- the parameter definition the value specifiedvalue
- the value specified.
-
requiresBuildPermission
public boolean requiresBuildPermission()Checks if accessgetChoiceList()
from REST API needs theItem.BUILD
permission. If true this will currently return the choices only for Job based API calls.- Returns:
- true if allow access to choices only if BUILD permission was granted. false otherwise.
- Since:
- 1.8.0
-
all
Returns all the ChoiceListProvider subclass whose DescriptorImpl is annotated with Extension.- Returns:
- DescriptorExtensionList of ChoiceListProvider subclasses.
-