Class ParameterizedBranchPropertyStrategy
java.lang.Object
hudson.model.AbstractDescribableImpl<jenkins.branch.BranchPropertyStrategy>
jenkins.branch.BranchPropertyStrategy
io.jenkins.plugins.multibranchparams.ParameterizedBranchPropertyStrategy
- All Implemented Interfaces:
ExtensionPoint,Describable<jenkins.branch.BranchPropertyStrategy>
public class ParameterizedBranchPropertyStrategy
extends jenkins.branch.BranchPropertyStrategy
A
BranchPropertyStrategy that applies ParameterizedBranchProperty
selectively to branches based on a name regex pattern.
Filter modes
ParameterizedBranchPropertyStrategy.FilterMode.ALL– every branch receives the parameters (default).ParameterizedBranchPropertyStrategy.FilterMode.INCLUDE_PATTERN– only branches whose names matchbranchPatternreceive the parameters.ParameterizedBranchPropertyStrategy.FilterMode.EXCLUDE_PATTERN– all branches except those matchingbranchPatternreceive the parameters.
For the simple "all branches" use case you can instead just use the Branch API's
built-in DefaultBranchPropertyStrategy and attach
ParameterizedBranchProperty to it. This strategy is for advanced filtering.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classJenkins extension descriptor forParameterizedBranchPropertyStrategy.static enumDetermines which branches receive the injected parameters.Nested classes/interfaces inherited from interface hudson.ExtensionPoint
ExtensionPoint.LegacyInstancesAreScopedToHudson -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionList<jenkins.branch.BranchProperty> getPropertiesFor(jenkins.scm.api.SCMHead head) Called by the Branch API for each discoveredSCMHead(branch/PR/tag).voidsetBranchPattern(String branchPattern) voidvoidsetParameterDefinitions(List<ParameterDefinition> parameterDefinitions) voidsetParameterPolicy(ParameterPolicy parameterPolicy) Methods inherited from class jenkins.branch.BranchPropertyStrategy
getDescriptor
-
Constructor Details
-
ParameterizedBranchPropertyStrategy
@DataBoundConstructor public ParameterizedBranchPropertyStrategy()Required by Stapler for data binding.
-
-
Method Details
-
getFilterMode
- Returns:
- the active
ParameterizedBranchPropertyStrategy.FilterMode
-
setFilterMode
@DataBoundSetter public void setFilterMode(ParameterizedBranchPropertyStrategy.FilterMode filterMode) -
getBranchPattern
- Returns:
- the Java regex used for branch name matching
-
setBranchPattern
-
getParameterDefinitions
- Returns:
- unmodifiable list of configured parameter definitions
-
setParameterDefinitions
@DataBoundSetter public void setParameterDefinitions(@NonNull List<ParameterDefinition> parameterDefinitions) -
getParameterPolicy
-
setParameterPolicy
-
getPropertiesFor
Called by the Branch API for each discoveredSCMHead(branch/PR/tag). Returns the list ofBranchPropertyinstances to apply to that branch's job.- Specified by:
getPropertiesForin classjenkins.branch.BranchPropertyStrategy- Parameters:
head- the SCM head representing the branch- Returns:
- singleton list with a configured
ParameterizedBranchProperty, or an empty list if the branch is filtered out
-