/** * {@inheritDoc} * * @return * null to avoid setting an instance of {@link JobProperty} to the target project (or just use {@link OptionalJobProperty}) */ @Override public JobProperty<?> newInstance(StaplerRequest req, JSONObject formData) throws FormException { // JobPropertyDescriptors are bit different in that we allow them even without any user-visible configuration parameter, // so replace the lack of form data by an empty one. if(formData.isNullObject()) formData=new JSONObject(); return super.newInstance(req, formData); }
/** * Creates a new instance of a {@link Describable} * from the structured form submission data posted * by a radio button group. * @param config Submitted configuration for Radio List * @return new instance or {@code null} if none was selected in the radio list * @throws FormException Data submission error */ @CheckForNull public T newInstanceFromRadioList(JSONObject config) throws FormException { if(config.isNullObject()) return null; // none was selected int idx = config.getInt("value"); return get(idx).newInstance(Stapler.getCurrentRequest(),config); }
if (signature.isNullObject()) { return FormValidation.error("No signature block found in "+name);
/** * Creates a new instance of a {@link Describable} * from the structured form submission data posted * by a radio button group. */ public T newInstanceFromRadioList(JSONObject config) throws FormException { if(config.isNullObject()) return null; // none was selected int idx = config.getInt("value"); return get(idx).newInstance(Stapler.getCurrentRequest(),config); }
@Override public boolean configure(StaplerRequest req, JSONObject json) throws FormException { try { Jenkins j = Jenkins.get(); JSONObject np = json.getJSONObject("globalNodeProperties"); if (!np.isNullObject()) { j.getGlobalNodeProperties().rebuild(req, np, NodeProperty.for_(j)); } return true; } catch (IOException e) { throw new FormException(e,"globalNodeProperties"); } } }
@Override public JobProperty<?> newInstance(StaplerRequest req, JSONObject formData) throws FormException { if (formData.isNullObject()) return null; JSONObject containersDefinition = formData.getJSONObject("containersDefinition"); if (containersDefinition.isNullObject()) return null; return req.bindJSON(ContainerSetDefinition.class, containersDefinition); }
/** * The hardware size which had the problem. */ public String getHardwareSize() { JSONObject hw = json.getJSONObject("affectedHardware"); if (! hw.isNullObject()) return hw.getString("size"); else return null; }
/** * Gets a time tracking object from the given object. * * @param tt a JSONObject instance * * @return a TimeTracking instance or null if tt isn't a JSONObject instance */ public static TimeTracking getTimeTracking(Object tt) { TimeTracking result = null; if (tt instanceof JSONObject && !((JSONObject)tt).isNullObject()) result = new TimeTracking((JSONObject)tt); return result; }
@Override public AggregatedTestResultPublisher newInstance(StaplerRequest req, JSONObject formData) throws FormException { JSONObject s = formData.getJSONObject("specify"); if(s.isNullObject()) return new AggregatedTestResultPublisher(null); else return new AggregatedTestResultPublisher(s.getString("jobs")); } }
@Override public AggregatedTestResultPublisher newInstance(StaplerRequest req, JSONObject formData) throws FormException { JSONObject s = formData.getJSONObject("specify"); if (s.isNullObject()) { return new AggregatedTestResultPublisher(null); } else { return new AggregatedTestResultPublisher(s.getString("jobs")); } } }
@Override public AggregatedTestResultPublisher newInstance(StaplerRequest req, JSONObject formData) throws FormException { JSONObject s = formData.getJSONObject("specify"); if(s.isNullObject()) return new AggregatedTestResultPublisher(null); else return new AggregatedTestResultPublisher(s.getString("jobs")); } }
private boolean isBranchChange() { if (!isEditedAction()) { return false; } JSONObject changes = this.payloadJson.getJSONObject("changes"); return !changes.isNullObject() && changes.containsKey("base"); }
/** * Creates a new instance of a {@link Describable} * from the structured form submission data posted * by a radio button group. */ public T newInstanceFromRadioList(JSONObject config) throws FormException { if(config.isNullObject()) return null; // none was selected int idx = config.getInt("value"); return get(idx).newInstance(Stapler.getCurrentRequest(),config); }
/** * Creates a new instance of a {@link Describable} from the structured form * submission data posted by a radio button group. */ public T newInstanceFromRadioList(JSONObject config) throws FormException { if (config.isNullObject()) { return null; // none was selected } int idx = config.getInt("value"); return get(idx).newInstance(Stapler.getCurrentRequest(), config); }
/** * Creates a new instance of a {@link Describable} * from the structured form submission data posted * by a radio button group. */ public T newInstanceFromRadioList(JSONObject config) throws FormException { if(config.isNullObject()) return null; // none was selected int idx = config.getInt("value"); return get(idx).newInstance(Stapler.getCurrentRequest(),config); }
/** * Creates a new instance of a {@link Describable} * from the structured form submission data posted * by a radio button group. */ public T newInstanceFromRadioList(JSONObject config) throws FormException { if(config.isNullObject()) return null; // none was selected int idx = config.getInt("value"); return get(idx).newInstance(Stapler.getCurrentRequest(),config); }
/** * Creates a new instance of a {@link Describable} * from the structured form submission data posted * by a radio button group. */ public T newInstanceFromRadioList(JSONObject config) throws FormException { if(config.isNullObject()) return null; // none was selected int idx = config.getInt("value"); return get(idx).newInstance(Stapler.getCurrentRequest(),config); }
/** * Creates a new instance of a {@link Describable} * from the structured form submission data posted * by a radio button group. */ public T newInstanceFromRadioList(JSONObject config) throws FormException { if(config.isNullObject()) return null; // none was selected int idx = config.getInt("value"); return get(idx).newInstance(Stapler.getCurrentRequest(),config); }
/** * Creates a new instance of a {@link Describable} from the structured form * submission data posted by a radio button group. */ public T newInstanceFromRadioList(JSONObject config) throws FormException { if (config.isNullObject()) { return null; // none was selected } int idx = config.getInt("value"); return get(idx).newInstance(Stapler.getCurrentRequest(), config); }
protected static ContentViewLayout getContentViewLayoutFromJSON(JSONObject jsonCvLayout) { if (jsonCvLayout == null || jsonCvLayout.isNullObject()) { return null; } String name = jsonCvLayout.optString("name", null); String title = jsonCvLayout.optString("title", null); boolean translateTitle = jsonCvLayout.optBoolean("translateTitle"); String iconPath = jsonCvLayout.optString("iconPath", null); boolean showCSVExport = jsonCvLayout.optBoolean("showCSVExport"); return new ContentViewLayoutImpl(name, title, translateTitle, iconPath, showCSVExport); }