Class ParameterDefinitionBranchProperty

  • All Implemented Interfaces:
    ExtensionPoint, Describable<BranchProperty>

    public abstract class ParameterDefinitionBranchProperty
    extends BranchProperty
    Support for build parameters. Left abstract (not registered by default for all projects) so that concrete subclasses can decide which project types they should apply to.
    • Constructor Detail

      • ParameterDefinitionBranchProperty

        protected ParameterDefinitionBranchProperty()
        Subclasses should have a DataBoundConstructor.
    • Method Detail

      • getParameterDefinitions

        @Exported
        public final List<ParameterDefinition> getParameterDefinitions()
        Gets the parameter definitions.
        Returns:
        the parameter definitions.
      • setParameterDefinitions

        @DataBoundSetter
        public final void setParameterDefinitions​(List<ParameterDefinition> parameterDefinitions)
        Sets the parameter definitions.
        Parameters:
        parameterDefinitions - the parameter definitions.
      • isApplicable

        @OverrideMustInvoke
        protected <P extends Job<P,​B>,​B extends Run<P,​B>> boolean isApplicable​(Class<P> clazz)
        Tests if the parameter definitions are applicable to the branch specific job type.

        Not to be confused with BranchPropertyDescriptor.isApplicable(MultiBranchProjectDescriptor), this checks applicability for the child job type.

        As all Job types support JobProperty and ParametersDefinitionProperty will work with anything that implements ParameterizedJobMixIn.ParameterizedJob, the default implementation which checks for both of these interfaces, should suffice for all. If you need to apply additional specification then you can override to tighten the criteria.

        Type Parameters:
        P - the type of the branch specific child job.
        B - the type of the branch specific child job's builds.
        Parameters:
        clazz - the type of the branch specific child job.
        Returns:
        true if the specified type of child job can be parameterized.
      • jobDecorator

        public final <P extends Job<P,​B>,​B extends Run<P,​B>> JobDecorator<P,​B> jobDecorator​(Class<P> clazz)
        Returns a JobDecorator for the specific job type.
        Overrides:
        jobDecorator in class BranchProperty
        Type Parameters:
        P - the type of job.
        B - the type of run of the job.
        Parameters:
        clazz - the job class.
        Returns:
        a JobDecorator or null if none appropriate to this type of job.