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

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.

  • 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

      public String getBranchPattern()
      Returns:
      the Java regex used for branch name matching
    • setBranchPattern

      @DataBoundSetter public void setBranchPattern(String branchPattern)
    • getParameterDefinitions

      public List<ParameterDefinition> getParameterDefinitions()
      Returns:
      unmodifiable list of configured parameter definitions
    • setParameterDefinitions

      @DataBoundSetter public void setParameterDefinitions(@NonNull List<ParameterDefinition> parameterDefinitions)
    • getParameterPolicy

      public ParameterPolicy getParameterPolicy()
    • setParameterPolicy

      @DataBoundSetter public void setParameterPolicy(@NonNull ParameterPolicy parameterPolicy)
    • getPropertiesFor

      @NonNull public List<jenkins.branch.BranchProperty> getPropertiesFor(jenkins.scm.api.SCMHead head)
      Called by the Branch API for each discovered SCMHead (branch/PR/tag). Returns the list of BranchProperty instances to apply to that branch's job.
      Specified by:
      getPropertiesFor in class jenkins.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