@Override @SuppressWarnings("unchecked") // cast to T[] public boolean configure(StaplerRequest req, JSONObject json) throws FormException { setInstallations(req.bindJSONToList(clazz, json.get("tool")).toArray((T[]) Array.newInstance(clazz, 0))); return true; }
/** * Accepts submission from the configuration page. */ @RequirePOST public synchronized void doConfigSubmit( StaplerRequest req, StaplerResponse rsp ) throws IOException, ServletException { JSONObject src = req.getSubmittedForm(); String newName = src.getString("name"), redirect = "."; XmlFile oldFile = null; if(!name.equals(newName)) { Jenkins.checkGoodName(newName); oldFile = getConfigFile(); // rename getParent().logRecorders.remove(name); this.name = newName; getParent().logRecorders.put(name,this); redirect = "../" + Util.rawEncode(newName) + '/'; } List<Target> newTargets = req.bindJSONToList(Target.class, src.get("targets")); for (Target t : newTargets) t.enable(); targets.replaceBy(newTargets); save(); if (oldFile!=null) oldFile.delete(); rsp.sendRedirect2(redirect); }
@Override public boolean configure(StaplerRequest req, JSONObject json) throws FormException { connections = req.bindJSONToList(GitLabConnection.class, json.get("connections")); useAuthenticatedEndpoint = json.getBoolean("useAuthenticatedEndpoint"); refreshConnectionMap(); save(); return super.configure(req, json); }
@Override public UserProperty newInstance(StaplerRequest req, JSONObject json) throws FormException { List<EmailTrigger> triggers = req != null ? req.bindJSONToList(EmailTrigger.class, json) : Collections.<EmailTrigger>emptyList(); return new UserProperty(triggers); } }
@Override @SuppressWarnings("unchecked") // cast to T[] public boolean configure(StaplerRequest req, JSONObject json) throws FormException { setInstallations(req.bindJSONToList(clazz, json.get("tool")).toArray((T[]) Array.newInstance(clazz, 0))); return true; }
@Override @SuppressWarnings("unchecked") // cast to T[] public boolean configure(StaplerRequest req, JSONObject json) throws FormException { setInstallations(req.bindJSONToList(clazz, json.get("tool")).toArray((T[]) Array.newInstance(clazz, 0))); return true; }
@Override @SuppressWarnings("unchecked") // cast to T[] public boolean configure(StaplerRequest req, JSONObject json) throws FormException { setInstallations(req.bindJSONToList(clazz, json.get("tool")).toArray((T[]) Array.newInstance(clazz, 0))); return true; }
@Override @SuppressWarnings("unchecked") // cast to T[] public boolean configure(StaplerRequest req, JSONObject json) throws FormException { setInstallations(req.bindJSONToList(clazz, json.get("tool")).toArray((T[]) Array.newInstance(clazz, 0))); return true; } }
@Override @SuppressWarnings("unchecked") // cast to T[] public boolean configure(StaplerRequest req, JSONObject json) throws FormException { setInstallations(req.bindJSONToList(clazz, json.get("tool")).toArray((T[]) Array.newInstance(clazz, 0))); return true; }
@Override public synchronized boolean configure(StaplerRequest req, JSONObject json) throws FormException { accessKeys = req.bindJSONToList(MetricsAccessKey.class, json.get("accessKeys")); accessKeySet = null; save(); return true; }
@Override public boolean configure(StaplerRequest req, JSONObject json) { List<SonarInstallation> list = req.bindJSONToList(SonarInstallation.class, json.get("inst")); boolean enableBuildWrapper = json.getBoolean("enableBuildWrapper"); setInstallations(list.toArray(new SonarInstallation[list.size()])); setBuildWrapperEnabled(enableBuildWrapper); return true; }
@Override public boolean configure(final StaplerRequest req, final JSONObject formData) { groovyParsers.replaceBy(req.bindJSONToList(GroovyParser.class, formData.get("parsers"))); save(); return true; }
@Override public boolean configure(final StaplerRequest req, final JSONObject formData) throws FormException { try { setColorMaps(req.bindJSONToList(AnsiColorMap.class, req.getSubmittedForm().get("colorMap")).toArray(new AnsiColorMap[1])); return true; } catch (ServletException e) { throw new FormException(e, ""); } }
@Override public boolean configure(StaplerRequest req, JSONObject formData) { sites.replaceBy(req.bindJSONToList(JiraSite.class, formData.get("sites"))); save(); return true; } }
@Override public boolean configure(StaplerRequest req, JSONObject formData) throws FormException { setProfiles(req.bindJSONToList(BlobStoreProfile.class, formData.get("profiles"))); save(); return true; }
@Override public boolean configure(StaplerRequest req, JSONObject formData) throws FormException { repos = req.bindJSONToList(DebianPackageRepo.class, formData.get("repositories")); save(); return super.configure(req,formData); }
@Override public boolean configure(final StaplerRequest req, final JSONObject formData) throws FormException { try { setColorMaps(req.bindJSONToList(AnsiColorMap.class, req.getSubmittedForm().get("colorMap")).toArray(new AnsiColorMap[0])); return true; } catch (ServletException e) { throw new FormException(e, ""); } }
@Override protected void submit(StaplerRequest req) throws IOException, ServletException, Descriptor.FormException { req.bindJSON(this, req.getSubmittedForm()); componentSpecs = req.bindJSONToList(ComponentSpec.class, req.getSubmittedForm().get("componentSpecs")); regexpFirstJobs = req.bindJSONToList(RegExpSpec.class, req.getSubmittedForm().get("regexpFirstJobs")); }
@Override public boolean configure(final StaplerRequest req, final JSONObject formData) throws FormException { try { setColorMaps(req.bindJSONToList(AnsiColorMap.class, req.getSubmittedForm().get("colorMap")).toArray(new AnsiColorMap[1])); return true; } catch (ServletException e) { throw new FormException(e, ""); } }
@Override protected void submit(StaplerRequest req) throws IOException, ServletException, Descriptor.FormException { req.bindJSON(this, req.getSubmittedForm()); componentSpecs = req.bindJSONToList(ComponentSpec.class, req.getSubmittedForm().get("componentSpecs")); }