private static ObjectMapper createDefaultMapper() { final ObjectMapper result = new ObjectMapper(); result.configure(SerializationConfig.Feature.INDENT_OUTPUT, true); result.registerModule(new MrBeanModule()); return result; }
private JsonMarshaller() { JsonFactory factory = new JsonFactory(); jsonMapper = new ObjectMapper(factory); jsonMapper.enableDefaultTypingAsProperty(ObjectMapper.DefaultTyping.NON_FINAL, "@class"); JsonUnknownPropertyHandler jsonUnknownPropertyHandler = new JsonUnknownPropertyHandler(); jsonMapper.getDeserializationConfig().addHandler(jsonUnknownPropertyHandler); jsonMapper.registerModule(new MrBeanModule()); }