@Override public UserProperty reconfigure(StaplerRequest req, JSONObject form) throws FormException { req.bindJSON(this, form); return this; }
/** * By default, calls {@link StaplerRequest#bindJSON(Object, JSONObject)}, * appropriate when your implementation has getters and setters for all fields. * <p>{@inheritDoc} */ @Override public boolean configure(StaplerRequest req, JSONObject json) throws FormException { req.bindJSON(this, json); return true; }
/** * Stick to the same object since there's no UI for this. */ @Override public UserProperty reconfigure(StaplerRequest req, JSONObject form) throws FormException { req.bindJSON(this, form); return this; }
@Override public Publisher newInstance(StaplerRequest req, JSONObject formData) { return req.bindJSON(Fingerprinter.class, formData); }
@Override public ArtifactArchiver newInstance(StaplerRequest req, JSONObject formData) throws FormException { return req.bindJSON(ArtifactArchiver.class,formData); }
/** * Creates an instance of {@link RepositoryBrowser} from a form submission. * * @since 1.227 */ public static <T extends RepositoryBrowser> T createInstance(Class<T> type, StaplerRequest req, JSONObject parent, String fieldName) throws FormException { JSONObject o = (JSONObject)parent.get(fieldName); if(o==null) return null; return req.bindJSON(type,o); } }
@Override public boolean configure(StaplerRequest req, JSONObject data) throws FormException { req.bindJSON(this, data); return super.configure(req, data); }
@Override public Builder newInstance(StaplerRequest req, JSONObject formData) throws FormException { if (req == null) { // This state is prohibited according to the Javadoc of the super method. throw new FormException("Maven Build Step new instance method is called for null Stapler request. " + "Such call is prohibited.", "req"); } return req.bindJSON(Maven.class,formData); } }
@Override public DefaultCrumbIssuer newInstance(StaplerRequest req, JSONObject formData) throws FormException { if (req == null) { // This state is prohibited according to the Javadoc of the super method. throw new FormException("DefaultCrumbIssuer new instance method is called for null Stapler request. " + "Such call is prohibited.", "req"); } return req.bindJSON(DefaultCrumbIssuer.class, formData); } }
@Override public ParameterValue createValue(StaplerRequest req, JSONObject jo) { RunParameterValue value = req.bindJSON(RunParameterValue.class, jo); value.setDescription(getDescription()); return value; }
@Override public ParameterValue createValue(StaplerRequest req, JSONObject jo) { BooleanParameterValue value = req.bindJSON(BooleanParameterValue.class, jo); value.setDescription(getDescription()); return value; }
@Override public ParameterValue createValue(StaplerRequest req, JSONObject jo) { TextParameterValue value = req.bindJSON(TextParameterValue.class, jo); value.setDescription(getDescription()); return value; }
public static GlobalSettingsProvider parseSettingsProvider(StaplerRequest req) throws Descriptor.FormException, ServletException { JSONObject settings = req.getSubmittedForm().getJSONObject("globalSettings"); if (settings == null) { return new DefaultGlobalSettingsProvider(); } return req.bindJSON(GlobalSettingsProvider.class, settings); }
@Override public ParameterValue createValue(StaplerRequest req, JSONObject jo) { StringParameterValue value = req.bindJSON(StringParameterValue.class, jo); value.setDescription(getDescription()); return checkValue(value); }
public static SettingsProvider parseSettingsProvider(StaplerRequest req) throws Descriptor.FormException, ServletException { JSONObject settings = req.getSubmittedForm().getJSONObject("settings"); if (settings == null) { return new DefaultSettingsProvider(); } return req.bindJSON(SettingsProvider.class, settings); }
@Override public ParameterValue createValue(StaplerRequest req, JSONObject jo) { StringParameterValue value = req.bindJSON(StringParameterValue.class, jo); if (isTrim() && value!=null) { value.doTrim(); } value.setDescription(getDescription()); return value; }
public FileParameterValue createValue(StaplerRequest req, JSONObject jo) { FileParameterValue p = req.bindJSON(FileParameterValue.class, jo); p.setLocation(getName()); p.setDescription(getDescription()); return p; }
@Override public PasswordParameterValue createValue(StaplerRequest req, JSONObject jo) { PasswordParameterValue value = req.bindJSON(PasswordParameterValue.class, jo); if (value.getValue().getPlainText().equals(DEFAULT_VALUE)) { value = new PasswordParameterValue(getName(), getDefaultValue()); } value.setDescription(getDescription()); return value; }
@Override public boolean configure(StaplerRequest req, JSONObject json) throws FormException { // for compatibility reasons, the actual value is stored in Jenkins Jenkins j = Jenkins.get(); if (json.has("viewsTabBar")) { j.setViewsTabBar(req.bindJSON(ViewsTabBar.class,json.getJSONObject("viewsTabBar"))); } else { j.setViewsTabBar(new DefaultViewsTabBar()); } return true; } }
@Override public boolean configure(StaplerRequest req, JSONObject json) throws FormException { // for compatibility reasons, the actual value is stored in Jenkins Jenkins j = Jenkins.get(); if (json.has("myViewsTabBar")) { j.setMyViewsTabBar(req.bindJSON(MyViewsTabBar.class,json.getJSONObject("myViewsTabBar"))); } else { j.setMyViewsTabBar(new DefaultMyViewsTabBar()); } return true; } }