Package jenkins.branch
Class ParameterDefinitionBranchProperty
java.lang.Object
hudson.model.AbstractDescribableImpl<BranchProperty>
jenkins.branch.BranchProperty
jenkins.branch.ParameterDefinitionBranchProperty
- All Implemented Interfaces:
ExtensionPoint,Describable<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.
-
Nested Class Summary
Nested classes/interfaces inherited from interface hudson.ExtensionPoint
ExtensionPoint.LegacyInstancesAreScopedToHudson -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedSubclasses should have aDataBoundConstructor. -
Method Summary
Modifier and TypeMethodDescriptionfinal List<ParameterDefinition>Gets the parameter definitions.isApplicable(Class<P> clazz) Tests if the parameter definitions are applicable to the branch specific job type.final <P extends Job<P,B>, B extends Run<P, B>>
JobDecorator<P,B> jobDecorator(Class<P> clazz) Returns aJobDecoratorfor the specific job type.final voidsetParameterDefinitions(List<ParameterDefinition> parameterDefinitions) Sets the parameter definitions.Methods inherited from class jenkins.branch.BranchProperty
asArrayList, decorator, decorator, getDescriptor
-
Constructor Details
-
ParameterDefinitionBranchProperty
protected ParameterDefinitionBranchProperty()Subclasses should have aDataBoundConstructor.
-
-
Method Details
-
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>, boolean isApplicableB extends Run<P, B>> (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
Jobtypes supportJobPropertyandParametersDefinitionPropertywill work with anything that implementsParameterizedJobMixIn.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:
trueif the specified type of child job can be parameterized.
-
jobDecorator
public final <P extends Job<P,B>, JobDecorator<P,B extends Run<P, B>> B> jobDecorator(Class<P> clazz) Returns aJobDecoratorfor the specific job type.- Overrides:
jobDecoratorin classBranchProperty- Type Parameters:
P- the type of job.B- the type of run of the job.- Parameters:
clazz- the job class.- Returns:
- a
JobDecoratorornullif none appropriate to this type of job.
-