Package com.fasterxml.jackson.databind.module

Examples of com.fasterxml.jackson.databind.module.SimpleModule.addDeserializer()


    }

    protected void init(ObjectMapper objectMapper) {
        SimpleModule module = new SimpleModule();
        module.addDeserializer(Event.class, eventDeserializer);
        module.addDeserializer(JsonObject.class, jsonObjectDeserializer);
        module.addDeserializer(AckArgs.class, ackArgsDeserializer);
        objectMapper.registerModule(module);

        objectMapper.setSerializationInclusion(Include.NON_NULL);
        objectMapper.configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false);
View Full Code Here


    protected void init(ObjectMapper objectMapper) {
        SimpleModule module = new SimpleModule();
        module.addDeserializer(Event.class, eventDeserializer);
        module.addDeserializer(JsonObject.class, jsonObjectDeserializer);
        module.addDeserializer(AckArgs.class, ackArgsDeserializer);
        objectMapper.registerModule(module);

        objectMapper.setSerializationInclusion(Include.NON_NULL);
        objectMapper.configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false);
        objectMapper.configure(SerializationFeature.WRITE_BIGDECIMAL_AS_PLAIN, true);
View Full Code Here

    org.bson.types.ObjectId oid = new org.bson.types.ObjectId();
    BSONObject o = new BasicBSONObject();
    o.put("oid", oid.toByteArray());
   
    SimpleModule mod = new SimpleModule();
    mod.addDeserializer(org.bson.types.ObjectId.class, new ObjectIdDeserializer());
   
    ObjectIdClass res = parseBsonObject(o, ObjectIdClass.class, mod);
    assertEquals(oid, res.oid);
  }
}
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. 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.