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); }
/** * Allow to add more attributes. * * @param json The json object to extract attributes from. */ void addAttributes(JSONObject json) { attributes.putAll(json); }
public void putAll(Map map, JsonConfig jsonConfig) { jsonObject.putAll(map, jsonConfig); }
/** * Load data into this document from a differing JSONObject * <p> * This is mainly for reloading data for an object that was retrieved from a view. This version * doesn't overwrite any unsaved data that is currently present in this object. * * @param object2 */ protected void load(JSONObject object2) { if (!loaded) { object.putAll(object2); loaded=true; } }
public void putAll(Map map) { jsonObject.putAll(map); }
public void putAll(Map arg0) { getJSONObject().putAll(arg0); } public Object remove(Object arg0) {
/** * Constructs a new response from MWS. * @param response The HTTP servlet response * @param data The data as a Map or JSON, will be converted correctly in either case * @param success Whether or not the response is a success * * @throws IllegalArgumentException If the data param is not a Map or JSON object */ public MoabRestResponse(MockHttpServletResponse response, Object data, boolean success) { this.response = response; // Properly convert if JSON or not if (data==null || data instanceof JSON) this.data = (JSON)data; else if (data instanceof Map) { JSONObject json = new JSONObject(); json.putAll((Map)data); this.data = json; } else throw new IllegalArgumentException("Argument [data] is not a valid type of Map or JSON"); this.success = success; }
private void updateResolverDeployer(Map<String, Object> arguments, Object valueToUpdate) throws IOException { // We don't want to handle the deserialization of the ArtifactoryServer. // Instead we will remove it and later on set it on the deployer object. Map<String, Object> serverlessArguments = new HashMap<>(arguments); serverlessArguments.remove("server"); JSONObject json = new JSONObject(); json.putAll(serverlessArguments); final ObjectMapper mapper = new ObjectMapper(); mapper.readerForUpdating(valueToUpdate).readValue(json.toString()); } }
/** * Override this if needed. The default behavior is to serialize everything in the * {@link UserInfo} object. * @return */ protected JSONObject createJSON() { JSONObject json = new JSONObject(); if (userInfo != null) { json.putAll(userInfo.getMap()); } return json; }
/** * This strips out claims that should not be returned, such as the nonce, but are part of the original * id token. * @param json * @return */ protected JSONObject stripClaims(JSONObject json){ JSONObject r = new JSONObject(); r.putAll(json);// new json object so we don't lose information and so we don't get concurrent update error String[] x = new String[]{ISSUED_AT, NONCE,EXPIRATION,EXPIRES_IN,AUTHORIZATION_TIME}; for(String y : x){ r.remove(y); } return r; } /**
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); }
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); }
/** * Performs the configuration of a specific {@link Descriptor}. * * @param req the request. * @param json the JSON object. * @param d the {@link Descriptor}. * @return {@code false} to keep the client in the same config page. * @throws FormException if something goes wrong. */ 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); }