@SuppressWarnings("unchecked") public <T extends IsProperties> T set(Object key, Object val) { if (val instanceof IsProperties) { p.set(key, ((IsProperties) val).getDataImpl()); } else { p.set(key, val); } return (T) this; }
@Override public IsProperties create(String s) { IsProperties ret = createBinder(); ret.parse(s); return ret; }
private void stripProxy(JsonBuilder proxy) throws Throwable { Class<?> type = proxy.getClass().getInterfaces()[0]; HashSet<String> validAttrs = getAttributeNames(type.getMethods()); Hashtable<String, Method> ispropertyGetters = getJsonBuilders(type.getMethods()); for (String key : jsonObject.keys()) { String name = methodName2AttrName(key); if (!validAttrs.contains(name)) { jsonObject.remove(key); continue; } Method ispropertyGetter = ispropertyGetters.get(name); if (ispropertyGetter != null) { ((IsProperties) invoke(proxy, ispropertyGetter, new Object[] {})).strip(); } } }
if (data != null) { String dataString = null, contentType = null; if (data.getDataImpl() instanceof JavaScriptObject && JsUtils.isFormData(data.<JavaScriptObject> getDataImpl())) { dataString = null; contentType = FormPanel.ENCODING_URLENCODED; } else if (settings.getType().matches("(POST|PUT)") && "json".equalsIgnoreCase(settings.getDataType())) { dataString = data.toJson(); contentType = JSON_CONTENT_TYPE_UTF8; } else { dataString = data.toQueryString(); contentType = FormPanel.ENCODING_URLENCODED;
String ctype = settings.getContentType(); Boolean isFormData = data != null && data.getDataImpl() instanceof JavaScriptObject && JsUtils.isFormData(data.<JavaScriptObject> getDataImpl()); for (String headerKey : headers.getFieldNames()) { xmlHttpRequest.setRequestHeader(headerKey, String.valueOf(headers.get(headerKey))); JsUtils.runJavascriptFunction(xmlHttpRequest, "send", isFormData ? data.getDataImpl() : settings.getDataString()); } catch (JavaScriptException e) {
for (String h : headers.getFieldNames()) { c.setRequestProperty(h, "" + headers.get(h));
public static Settings createSettings(IsProperties p) { Settings s = GQ.create(Settings.class); s.load(p.getDataImpl()); return s; }
valClaz = String.class; } else if (val instanceof IsProperties) { val = ((IsProperties) val).getDataImpl(); } else if (val.getClass().isArray() || val instanceof List) { val =
public static IsProperties create(String s) { return getFactory().create(s); }