public JsonConfig getJsonConfig() { if (jsonConfig == null) { jsonConfig = new JsonConfig(); } return jsonConfig; }
JsonConfig config = new JsonConfig(); config.registerJsonValueProcessor( Class.forName("java.util.Date"), new NiceDateJsonBeanProcessor()); final JSONObject jsonObjectForDate = JSONSerializer.toJSON(object, jsonConfig)
JsonConfig jsonConfig = new JsonConfig(); jsonConfig.setRootClass(Class2.class); Map<String, Class> classMap = new HashMap<String, Class>(); classMap.put("students", Student.class); // 指定JsonRpcRequest的request字段的内部类型 jsonConfig.setClassMap(classMap);
@Override public JsonConfig getJsonConfig() { JsonConfig jsonConfig = new JsonConfig(); jsonConfig.registerJsonValueProcessor(YuiId.class, new YuiIdProcessor()); return jsonConfig; }
PropertyFilter pf = new PropertyFilter(){ public boolean apply( Object source, String name, Object value ) { if( value != null && Number.class.isAssignableFrom( value.getClass() ) ){ return true; } return false; } }; PrimitiveBean bean = new PrimitiveBean(); JsonConfig jsonConfig = new JsonConfig(); jsonConfig.setJsonPropertyFilter(pf); JSONObject json = JSONObject.fromObject( bean, jsonConfig );
JSONArray jsonArray = (JSONArray) JSONSerializer.toJSON( input ); JsonConfig jsonConfig = new JsonConfig(); jsonConfig.setArrayMode( JsonConfig.MODE_OBJECT_ARRAY ); jsonConfig.setRootClass( Integer.TYPE ); int[] output = (int[]) JSONSerializer.toJava( jsonArray, jsonConfig );
@Override public JsonConfig getJsonConfig() { JsonConfig jsonConfig = new JsonConfig(); jsonConfig.registerJsonValueProcessor(YuiId.class, new YuiIdProcessor()); return jsonConfig; } };
@Override public JsonConfig getJsonConfig() { JsonConfig jsonConfig = new JsonConfig(); jsonConfig.registerJsonValueProcessor(YuiId.class, new YuiIdProcessor()); return jsonConfig; } };
private JsonConfig internalGetJsonConfig(Serializable serializable) { JsonConfig jsonConfig = new JsonConfig(); decorateJsonConfig(jsonConfig); if (serializable != null && serializable instanceof IAjaxSettings) { jsonConfig.registerJsonValueProcessor(JsFunction.class, new JsFunctionProcessor()); } return jsonConfig; }
public JsonConfig getJsonConfig() { JsonConfig config = new JsonConfig(); Serializable settings = getSettings(); if(settings != null && settings instanceof IAjaxSettings) { config.registerJsonValueProcessor(JsFunction.class, new JsFunctionProcessor()); } return config; }
public static GitStatusContext fromJsonString(final String jsonString) { final JSONObject jsonObject = JSONObject.fromObject(jsonString); final GitStatusContext result; final JsonConfig jsonConfig = new JsonConfig(); jsonConfig.setRootClass(GitStatusContext.class); result = (GitStatusContext) JSONObject.toBean(jsonObject, jsonConfig); return result; } }
/** * Returns a JSON response with the statistics for severity. * * @return the UI model as JSON */ @JavaScriptMethod @SuppressWarnings("unused") // Called by jelly view public JSONObject getSeverityDistributionJson() { JsonConfig jsonConfig = new JsonConfig(); jsonConfig.setExcludes( new String[]{ "buildNumber"} ); return JSONObject.fromObject(severityDistribution, jsonConfig); }
private JsonConfig internalGetJsonConfig(Serializable serializable) { JsonConfig jsonConfig = new JsonConfig(); decorateJsonConfig(jsonConfig); if (serializable != null && serializable instanceof IAjaxSettings) { jsonConfig.registerJsonValueProcessor(JsFunction.class, new JsFunctionProcessor()); } return jsonConfig; }
public JsonConfig getJsonConfig() { JsonConfig config = new JsonConfig(); Serializable settings = getSettings(); if(settings != null && settings instanceof IAjaxSettings) { config.registerJsonValueProcessor(JsFunction.class, new JsFunctionProcessor()); } return config; }
private JsonConfig internalGetJsonConfig(Serializable serializable) { JsonConfig jsonConfig = new JsonConfig(); decorateJsonConfig(jsonConfig); if (serializable != null && serializable instanceof IAjaxSettings) { jsonConfig.registerJsonValueProcessor(JsFunction.class, new JsFunctionProcessor()); } return jsonConfig; }
public JsonConfig getJsonConfig() { JsonConfig config = new JsonConfig(); Serializable settings = getSettings(); if(settings != null && settings instanceof IAjaxSettings) { config.registerJsonValueProcessor(JsFunction.class, new JsFunctionProcessor()); } return config; }
JsonConfig jsonConfig = new JsonConfig(); jsonConfig.setExcludes(new String[]{"files", "createdBy", "lastUpdatedBy"}); jsonConfig.setIgnoreDefaultExcludes(false); jsonConfig.setCycleDetectionStrategy(CycleDetectionStrategy.LENIENT); JSONObject jsonObject = JSONObject.fromObject(obj, config);
@Override public JsonConfig getJsonConfig() { JsonConfig jsonConfig = new JsonConfig(); jsonConfig.setExcludes(new String[] {"markupId"}); jsonConfig.registerJsonValueProcessor(YuiId.class, new YuiIdProcessor()); jsonConfig.registerJsonValueProcessor(JsFunction.class, new JsFunctionProcessor()); return jsonConfig; } };
@Override public JsonConfig getJsonConfig() { JsonConfig jsonConfig = new JsonConfig(); jsonConfig.setExcludes(new String[]{"markupId"}); jsonConfig.registerJsonValueProcessor(YuiId.class, new YuiIdProcessor()); jsonConfig.registerJsonValueProcessor(JsFunction.class, new JsFunctionProcessor()); return jsonConfig; } };
@Override public JsonConfig getJsonConfig() { JsonConfig jsonConfig = new JsonConfig(); jsonConfig.setExcludes(new String[] {"markupId"}); jsonConfig.registerJsonValueProcessor(YuiId.class, new YuiIdProcessor()); jsonConfig.registerJsonValueProcessor(JsFunction.class, new JsFunctionProcessor()); return jsonConfig; } };