Package cc.plural.jsonij.marshal.helpers

Examples of cc.plural.jsonij.marshal.helpers.HandlerConfiguration


    }

    @Test
    public void testMarshalHandlerClass() throws JSONMarshalerException, IOException, ParserException, IllegalAccessException, InstantiationException, ClassNotFoundException {
        System.out.println("testMarshalHandlerClass");
        HandlerConfiguration config = new HandlerConfiguration();
        Map<String, Class<?>> handlers = new HashMap<String, Class<?>>();
        handlers.put("http", JSON.class);
        handlers.put("ftp", JSONMarshaler.class);
        config.setHandlers(handlers);
       
        JSON outputJSON = JSONMarshaler.marshalObject(config);
        System.out.println("Output JSON (no codec):" + outputJSON);

        JSONMarshaler.registerCodec(Class.class, ClassJSONValueCodec.class);

        outputJSON = JSONMarshaler.marshalObject(config);
        System.out.println("Output JSON (codec):" + outputJSON);

        HandlerConfiguration reload = (HandlerConfiguration) JSONMarshaler.marshalJSON(outputJSON, config.getClass());
        assertNotNull(reload);
        assertEquals(config.getHandlers(), reload.getHandlers());
    }
View Full Code Here

TOP

Related Classes of cc.plural.jsonij.marshal.helpers.HandlerConfiguration

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.