Package org.neo4j.smack.serialization

Examples of org.neo4j.smack.serialization.JsonDeserializer


    @Test
    public void testReadingMap() throws Exception {
        InputStream in = new ByteArrayInputStream("{\"firstkey\":1,\"secondkey\":2}".getBytes("UTF-8"));
       
        JsonDeserializer d = new JsonDeserializer(new JsonFactory(new ObjectMapper()), in);
       
        Map<String,Object> deserialized = d.readMap();
       
        assertThat(deserialized.containsKey("firstkey"), is(true));
        assertThat(deserialized.containsKey("secondkey"), is(true));
       
        assertThat((Integer)deserialized.get("firstkey"), is(1));
View Full Code Here


   
    public <T> T deserialize(byte[] bytes,
            DeserializationStrategy<T> strategy)
    {
        InputStream in = new ByteArrayInputStream(bytes);
        JsonDeserializer deserializer = new JsonDeserializer(jsonFactory, in);
        return strategy.deserialize(deserializer);
    }
View Full Code Here

TOP

Related Classes of org.neo4j.smack.serialization.JsonDeserializer

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.