Class InheritanceParametersDefinitionProperty
- java.lang.Object
-
- hudson.model.JobProperty<J>
-
- jenkins.model.OptionalJobProperty<Job<?,?>>
-
- hudson.model.ParametersDefinitionProperty
-
- hudson.plugins.project_inheritance.projects.parameters.InheritanceParametersDefinitionProperty
-
- All Implemented Interfaces:
ExtensionPoint
,Action
,Describable<JobProperty<?>>
,ModelObject
,ReconfigurableDescribable<JobProperty<?>>
,BuildStep
public class InheritanceParametersDefinitionProperty extends ParametersDefinitionProperty
This class is a wrapper aroundParametersDefinitionProperty
.This is necessary, because
ParametersDefinitionProperty
does not expose the setOwner() method, which is needed for the GUI to work correctly.It also changes the parameter GUI to correctly handle the "isHidden" property of parameters.
- Author:
- mhschroe
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
InheritanceParametersDefinitionProperty.DescriptorImpl
-
Nested classes/interfaces inherited from class jenkins.model.OptionalJobProperty
OptionalJobProperty.OptionalJobPropertyDescriptor
-
Nested classes/interfaces inherited from interface hudson.tasks.BuildStep
BuildStep.PublisherList
-
Nested classes/interfaces inherited from interface hudson.ExtensionPoint
ExtensionPoint.LegacyInstancesAreScopedToHudson
-
-
Field Summary
Fields Modifier and Type Field Description static Comparator<ParameterDefinition>
paramComp
-
Fields inherited from class hudson.model.JobProperty
owner
-
Fields inherited from interface hudson.tasks.BuildStep
BUILDERS, PUBLISHERS
-
-
Constructor Summary
Constructors Constructor Description InheritanceParametersDefinitionProperty(AbstractProject<?,?> owner, ParameterDefinition... parameterDefinitions)
InheritanceParametersDefinitionProperty(AbstractProject<?,?> owner, ParametersDefinitionProperty other)
InheritanceParametersDefinitionProperty(AbstractProject<?,?> owner, List<ParameterDefinition> parameterDefinitions)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description void
_doBuild(org.kohsuke.stapler.StaplerRequest req, org.kohsuke.stapler.StaplerResponse rsp)
Deprecated.void
_doBuild(org.kohsuke.stapler.StaplerRequest req, org.kohsuke.stapler.StaplerResponse rsp, TimeDuration delay)
void
buildWithParameters(org.kohsuke.stapler.StaplerRequest req, org.kohsuke.stapler.StaplerResponse rsp)
void
buildWithParameters(org.kohsuke.stapler.StaplerRequest req, org.kohsuke.stapler.StaplerResponse rsp, TimeDuration delay)
static void
checkParameterSanity(InheritanceBuild build, BuildListener listener)
This checks if the assignment of all variables via Inheritance is sane and okay.static List<ParameterDefinition>
copySortParameters(List<ParameterDefinition> in)
OptionalJobProperty.OptionalJobPropertyDescriptor
getDescriptor()
We need to override this method do prevent Jenkins from trying to register this class as a "real" property worthy of inclusion in the configuration view.List<ParameterDefinition>
getParameterDefinitionSubset(boolean showHidden)
static Collection<ParameterValue>
getParameterValues(Run<?,?> run)
-
Methods inherited from class hudson.model.ParametersDefinitionProperty
getDisplayName, getIconFileName, getJob, getJobActions, getJobActions, getOwner, getParameterDefinition, getParameterDefinitionNames, getParameterDefinitions, getProject, getUrlName
-
Methods inherited from class hudson.model.JobProperty
getJobAction, getJobOverrides, getProjectAction, getProjectActions, getRequiredMonitorService, getSubTasks, perform, prebuild, reconfigure, setOwner
-
-
-
-
Field Detail
-
paramComp
public static Comparator<ParameterDefinition> paramComp
-
-
Constructor Detail
-
InheritanceParametersDefinitionProperty
public InheritanceParametersDefinitionProperty(AbstractProject<?,?> owner, List<ParameterDefinition> parameterDefinitions)
-
InheritanceParametersDefinitionProperty
public InheritanceParametersDefinitionProperty(AbstractProject<?,?> owner, ParameterDefinition... parameterDefinitions)
-
InheritanceParametersDefinitionProperty
public InheritanceParametersDefinitionProperty(AbstractProject<?,?> owner, ParametersDefinitionProperty other)
-
-
Method Detail
-
copySortParameters
public static final List<ParameterDefinition> copySortParameters(List<ParameterDefinition> in)
-
_doBuild
@Deprecated public void _doBuild(org.kohsuke.stapler.StaplerRequest req, org.kohsuke.stapler.StaplerResponse rsp) throws IOException, javax.servlet.ServletException
Deprecated.- Overrides:
_doBuild
in classParametersDefinitionProperty
- Throws:
IOException
javax.servlet.ServletException
-
_doBuild
public void _doBuild(org.kohsuke.stapler.StaplerRequest req, org.kohsuke.stapler.StaplerResponse rsp, @QueryParameter TimeDuration delay) throws IOException, javax.servlet.ServletException
- Overrides:
_doBuild
in classParametersDefinitionProperty
- Throws:
IOException
javax.servlet.ServletException
-
buildWithParameters
@Deprecated public void buildWithParameters(org.kohsuke.stapler.StaplerRequest req, org.kohsuke.stapler.StaplerResponse rsp) throws IOException, javax.servlet.ServletException
- Overrides:
buildWithParameters
in classParametersDefinitionProperty
- Throws:
IOException
javax.servlet.ServletException
-
buildWithParameters
public void buildWithParameters(org.kohsuke.stapler.StaplerRequest req, org.kohsuke.stapler.StaplerResponse rsp, @CheckForNull TimeDuration delay) throws IOException, javax.servlet.ServletException
- Overrides:
buildWithParameters
in classParametersDefinitionProperty
- Throws:
IOException
javax.servlet.ServletException
-
checkParameterSanity
public static void checkParameterSanity(InheritanceBuild build, BuildListener listener) throws Run.RunnerAbortedException
This checks if the assignment of all variables via Inheritance is sane and okay.It checks if:
- A fixed value was overwritten
- The mustHaveValue flag was set, but no value is present
- Parameters do not override incompatible classes
AbortException
.Do note that this check is different from and complementary to the check in
InheritanceProject.getParameterSanity()
.Of special note here is that this method does not check whether the parameters have compatible classes during inheritance. That is done on the level of the project as a pre-build check.
- Parameters:
build
- the build that uses a valuelistener
- the log emitter for that build- Throws:
Run.RunnerAbortedException
- thrown in case of an invalid assignment.
-
getParameterValues
public static Collection<ParameterValue> getParameterValues(Run<?,?> run)
-
getParameterDefinitionSubset
public List<ParameterDefinition> getParameterDefinitionSubset(boolean showHidden)
-
getDescriptor
public OptionalJobProperty.OptionalJobPropertyDescriptor getDescriptor()
We need to override this method do prevent Jenkins from trying to register this class as a "real" property worthy of inclusion in the configuration view.This is necessary, because this class is only a pure wrapper around
ParametersDefinitionProperty
and does not own any properties that need to be stored separately.Unfortunately; not defining a Descriptor at all would lead to this class not being able to completely wrap the
ParametersDefinitionProperty
class.- Specified by:
getDescriptor
in interfaceDescribable<JobProperty<?>>
- Overrides:
getDescriptor
in classOptionalJobProperty<Job<?,?>>
-
-