use of com.cloudbees.jenkins.support.api.ObjectComponentDescriptor in project support-core-plugin by jenkinsci.
the class SupportObjectAction method parseRequest.
/**
* Parse the stapler JSON output and retrieve configured components.
*
* @param req the request
* @return the {@link DescribableList} of components
*/
protected final List<ObjectComponent<T>> parseRequest(StaplerRequest req) throws ServletException, Descriptor.FormException {
// Inspired by https://github.com/jenkinsci/workflow-job-plugin/blob/workflow-job-2.35/src/main/java/org/jenkinsci/plugins/workflow/job/properties/PipelineTriggersJobProperty.java
DescribableList<ObjectComponent<T>, ObjectComponentDescriptor<T>> components = new DescribableList<>(Saveable.NOOP);
try {
JSONObject componentsSection = req.getSubmittedForm().getJSONObject("components");
components.rebuild(req, componentsSection, getApplicableComponentsDescriptors());
} catch (IOException e) {
throw new Descriptor.FormException(e, "components");
}
return components;
}
Aggregations