protected final <T extends Describable<T>> List<T> buildDescribable(StaplerRequest req, List<? extends Descriptor<T>> descriptors) throws FormException, ServletException { JSONObject data = req.getSubmittedForm(); List<T> r = new Vector<T>(); for (Descriptor<T> d : descriptors) { String safeName = d.getJsonSafeClassName(); if (req.getParameter(safeName) != null) { T instance = d.newInstance(req, data.getJSONObject(safeName)); r.add(instance); } } return r; }
private boolean configureDescriptor(StaplerRequest req, JSONObject json, Descriptor<?> d) throws FormException { // collapse the structure to remain backward compatible with the JSON structure before 1. String name = d.getJsonSafeClassName(); JSONObject js = json.has(name) ? json.getJSONObject(name) : new JSONObject(); // if it doesn't have the property, the method returns invalid null object. json.putAll(js); return d.configure(req, js); }
private boolean configureDescriptor(StaplerRequest req, JSONObject json, Descriptor<?> d) throws FormException { // collapse the structure to remain backward compatible with the JSON structure before 1. String name = d.getJsonSafeClassName(); JSONObject js = json.has(name) ? json.getJSONObject(name) : new JSONObject(); // if it doesn't have the property, the method returns invalid null object. json.putAll(js); return d.configure(req, js); }
private boolean configureDescriptor(StaplerRequest req, JSONObject json, Descriptor<?> d) throws Descriptor.FormException { String name = d.getJsonSafeClassName(); JSONObject js = json.has(name) ? json.getJSONObject(name) : new JSONObject(); // if it doesn't have the property, the method returns invalid null object. json.putAll(js); return d.configure(req, js); }
String name = d.getJsonSafeClassName(); JSONObject o = json.optJSONObject(name);
/** * Removes a {@link BuildStep} builder from this project, if it's active. * * @param builder builder. * @throws java.io.IOException exception. */ @Override public void removeBuilder(Descriptor<Builder> builder) throws IOException { removeProjectProperty(builder.getJsonSafeClassName()); save(); }
/** * Removes a buildWrapper from this project, if it's active. * * @param buildWrapper buildWrapper. * @throws java.io.IOException exception. */ @Override public void removeBuildWrapper(Descriptor<BuildWrapper> buildWrapper) throws IOException { removeProjectProperty(buildWrapper.getJsonSafeClassName()); save(); }
/** * Removes a publisher from this project, if it's active. * * @param publisher publisher. * @throws java.io.IOException exception. */ public void removePublisher(Descriptor<Publisher> publisher) throws IOException { removeProjectProperty(publisher.getJsonSafeClassName()); save(); }
/** * Removes a publisher from this project, if it's active. * * @param publisher publisher. * @throws java.io.IOException exception. */ public void removePublisher(Descriptor<Publisher> publisher) throws IOException { removeProjectProperty(publisher.getJsonSafeClassName()); save(); }
/** * Removes a publisher from this project, if it's active. * * @param publisher publisher. * @throws java.io.IOException exception. */ public void removePublisher(Descriptor<Publisher> publisher) throws IOException { removeProjectProperty(publisher.getJsonSafeClassName()); save(); }
/** * Removes a publisher from this project, if it's active. * * @param publisher publisher. * @throws java.io.IOException exception. */ @Override public void removePublisher(Descriptor<Publisher> publisher) throws IOException { removeProjectProperty(publisher.getJsonSafeClassName()); save(); }
protected final <T extends Describable<T>> List<T> buildDescribable(StaplerRequest req, List<? extends Descriptor<T>> descriptors) throws FormException, ServletException { JSONObject data = req.getSubmittedForm(); List<T> r = new Vector<T>(); for (Descriptor<T> d : descriptors) { String safeName = d.getJsonSafeClassName(); if (req.getParameter(safeName) != null) { T instance = d.newInstance(req, data.getJSONObject(safeName)); r.add(instance); } } return r; }
/** * Adds a new {@link BuildStep} to this {@link Project} and saves the configuration. * * @param publisher publisher. * @throws java.io.IOException exception. */ @SuppressWarnings("unchecked") public void addPublisher(Publisher publisher) throws IOException { CascadingUtil.getExternalProjectProperty(this, publisher.getDescriptor().getJsonSafeClassName()).setValue(publisher); save(); }
/** * Adds a new {@link BuildStep} to this {@link Project} and saves the configuration. * * @param publisher publisher. * @throws java.io.IOException exception. */ @SuppressWarnings("unchecked") public void addPublisher(Publisher publisher) throws IOException { CascadingUtil.getExternalProjectProperty(this, publisher.getDescriptor().getJsonSafeClassName()).setValue(publisher); save(); }
private boolean configureDescriptor(StaplerRequest req, JSONObject json, Descriptor<?> d) throws FormException { // collapse the structure to remain backward compatible with the JSON structure before 1. String name = d.getJsonSafeClassName(); JSONObject js = json.has(name) ? json.getJSONObject(name) : new JSONObject(); // if it doesn't have the property, the method returns invalid null object. json.putAll(js); return d.configure(req, js); }
private boolean configureDescriptor(StaplerRequest req, JSONObject json, Descriptor<?> d) throws Descriptor.FormException { String name = d.getJsonSafeClassName(); JSONObject js = json.has(name) ? json.getJSONObject(name) : new JSONObject(); // if it doesn't have the property, the method returns invalid null object. json.putAll(js); return d.configure(req, js); }
private boolean configureDescriptor(StaplerRequest req, JSONObject json, Descriptor<?> d) throws FormException { // collapse the structure to remain backward compatible with the JSON structure before 1. String name = d.getJsonSafeClassName(); JSONObject js = json.has(name) ? json.getJSONObject(name) : new JSONObject(); // if it doesn't have the property, the method returns invalid null object. json.putAll(js); return d.configure(req, js); }
private boolean configureDescriptor(StaplerRequest req, JSONObject json, Descriptor<?> d) throws FormException { // collapse the structure to remain backward compatible with the JSON structure before 1. String name = d.getJsonSafeClassName(); JSONObject js = json.has(name) ? json.getJSONObject(name) : new JSONObject(); // if it doesn't have the property, the method returns invalid null object. json.putAll(js); return d.configure(req, js); }
private boolean configureDescriptor(StaplerRequest req, JSONObject json, Descriptor<?> d) throws FormException { // collapse the structure to remain backward compatible with the JSON structure before 1. String name = d.getJsonSafeClassName(); JSONObject js = json.has(name) ? json.getJSONObject(name) : new JSONObject(); // if it doesn't have the property, the method returns invalid null object. json.putAll(js); return d.configure(req, js); }
private boolean configureDescriptor(StaplerRequest req, JSONObject json, Descriptor<?> d) throws FormException { // collapse the structure to remain backward compatible with the JSON structure before 1. String name = d.getJsonSafeClassName(); JSONObject js = json.has(name) ? json.getJSONObject(name) : new JSONObject(); // if it doesn't have the property, the method returns invalid null object. json.putAll(js); return d.configure(req, js); }