Package jenkins.branch
Class ParameterDefinitionBranchProperty
- java.lang.Object
-
- hudson.model.AbstractDescribableImpl<BranchProperty>
-
- jenkins.branch.BranchProperty
-
- jenkins.branch.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.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface hudson.ExtensionPoint
ExtensionPoint.LegacyInstancesAreScopedToHudson
-
-
Constructor Summary
Constructors Modifier Constructor Description protected
ParameterDefinitionBranchProperty()
Subclasses should have aDataBoundConstructor
.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description List<ParameterDefinition>
getParameterDefinitions()
Gets the parameter definitions.protected <P extends Job<P,B>,B extends Run<P,B>>
booleanisApplicable(Class<P> clazz)
Tests if the parameter definitions are applicable to the branch specific job type.<P extends Job<P,B>,B extends Run<P,B>>
JobDecorator<P,B>jobDecorator(Class<P> clazz)
Returns aJobDecorator
for the specific job type.void
setParameterDefinitions(List<ParameterDefinition> parameterDefinitions)
Sets the parameter definitions.-
Methods inherited from class jenkins.branch.BranchProperty
asArrayList, decorator, decorator, getDescriptor
-
-
-
-
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 supportJobProperty
andParametersDefinitionProperty
will 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:
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 aJobDecorator
for the specific job type.- Overrides:
jobDecorator
in classBranchProperty
- Type Parameters:
P
- the type of job.B
- the type of run of the job.- Parameters:
clazz
- the job class.- Returns:
- a
JobDecorator
ornull
if none appropriate to this type of job.
-
-