Package org.amplafi.json.renderers

Examples of org.amplafi.json.renderers.MapJsonRenderer


    }

    @SuppressWarnings("unchecked")
    @Test
    public void testBasic() {
        MapJsonRenderer renderer = new MapJsonRenderer(false);
        JSONStringer jsonWriter = new JSONStringer();
        jsonWriter.addRenderer(renderer);
        Map<String, Object> map = new LinkedHashMap<String, Object>();
        jsonWriter.value(map);
        assertEquals(jsonWriter.toString(), "{}");
View Full Code Here


        assertEquals(jsonWriter.toString(), "{\"foo\":true,\"bar\":{},\"str\":\"'\\\":);\"}");
    }

    @Test
    public void testNullFiltering() {
        MapJsonRenderer renderer = new MapJsonRenderer(false);
        JSONStringer jsonWriter = new JSONStringer();
        jsonWriter.addRenderer(renderer);
        Map<String, Object> map = new LinkedHashMap<String, Object>();
        map.put(null, "gg");
        map.put("ff", null);
View Full Code Here

    /**
     * allow null values but not null keys
     */
    @Test
    public void testAllowNulls() {
        MapJsonRenderer renderer = new MapJsonRenderer(true);
        JSONStringer jsonWriter = new JSONStringer();
        jsonWriter.addRenderer(renderer);
        Map<String, Object> map = new LinkedHashMap<String, Object>();
        map.put("ff", null);
        jsonWriter.value(map);
View Full Code Here

        FlowStateImpl flowState = flowManagement.startFlowState(flowTypeName, true, null, null);
        flowState.finishFlow();
        return flowState;
    }
    private JSONWriter getJsonWriter() {
        MapJsonRenderer mapJsonRenderer = new MapJsonRenderer();
        JSONWriter jsonWriter = new JSONStringer();
        jsonWriter.addRenderer(FlowValidationResultJsonRenderer.INSTANCE);
        jsonWriter.addRenderer(FlowValidationTrackingJsonRenderer.INSTANCE);
        jsonWriter.addRenderer(new FlowStateJsonRenderer(true));
        jsonWriter.addRenderer(mapJsonRenderer);
View Full Code Here

*/
public class MapFlowTranslator<K,V> extends AbstractFlowTranslator<Map<? extends K, ? extends V>> {
    private Class<?> translatedClass = Map.class;
    private Class<?> defaultObjectClass = LinkedHashMap.class;
    public MapFlowTranslator() {
        super(new MapJsonRenderer());
        this.addSerializedFormClasses(JSONObject.class);
    }
View Full Code Here

TOP

Related Classes of org.amplafi.json.renderers.MapJsonRenderer

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.