本文整理了Java中org.killbill.billing.util.jackson.ObjectMapper.disable()
方法的一些代码示例,展示了ObjectMapper.disable()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。ObjectMapper.disable()
方法的具体详情如下:
包路径:org.killbill.billing.util.jackson.ObjectMapper
类名称:ObjectMapper
方法名:disable
暂无
代码示例来源:origin: killbill/killbill
private ObjectMapper(final SmileFactory f) {
super(f);
this.registerModule(new JodaModule());
this.disable(SerializationFeature.WRITE_DATES_AS_TIMESTAMPS);
this.disable(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES);
}
代码示例来源:origin: killbill/killbill
@Test(groups = "fast")
public void testBasic() throws Exception {
final ObjectMapper objectMapper = new ObjectMapper();
objectMapper.registerModule(new JodaModule());
objectMapper.disable(SerializationFeature.WRITE_DATES_AS_TIMESTAMPS);
final String eventJson = "\"{\"pluginName\":\"foo\",\"pluginVersion\":\"1.2.3\",\"properties\":[{\"key\":\"something\",\"value\":\"nothing\"}]}\"";
final BroadcastInternalEvent broadcastEvent = new DefaultBroadcastInternalEvent("service", "PLUGIN_INSTALL", eventJson);
final String broadcastEventStr = objectMapper.writeValueAsString(broadcastEvent);
final BroadcastInternalEvent res = objectMapper.readValue(broadcastEventStr, DefaultBroadcastInternalEvent.class);
Assert.assertEquals(res.getServiceName(), "service");
Assert.assertEquals(res.getType(), "PLUGIN_INSTALL");
Assert.assertEquals(res.getJsonEvent(), eventJson);
}
}
代码示例来源:origin: org.kill-bill.billing/killbill-util
private ObjectMapper(final SmileFactory f) {
super(f);
this.registerModule(new JodaModule());
this.disable(SerializationFeature.WRITE_DATES_AS_TIMESTAMPS);
this.disable(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES);
}
代码示例来源:origin: org.kill-bill.billing/killbill-beatrix
FakeKPMPlugin() {
this.nodeInfoMapper = new NodeInfoMapper();
this.objectMapper = new ObjectMapper();
objectMapper.registerModule(new JodaModule());
objectMapper.disable(SerializationFeature.WRITE_DATES_AS_TIMESTAMPS);
}
代码示例来源:origin: org.kill-bill.billing/killbill-util
@Test(groups = "fast")
public void testBasic() throws Exception {
final ObjectMapper objectMapper = new ObjectMapper();
objectMapper.registerModule(new JodaModule());
objectMapper.disable(SerializationFeature.WRITE_DATES_AS_TIMESTAMPS);
final String eventJson = "\"{\"pluginName\":\"foo\",\"pluginVersion\":\"1.2.3\",\"properties\":[{\"key\":\"something\",\"value\":\"nothing\"}]}\"";
final BroadcastInternalEvent broadcastEvent = new DefaultBroadcastInternalEvent("service", "PLUGIN_INSTALL", eventJson);
final String broadcastEventStr = objectMapper.writeValueAsString(broadcastEvent);
final BroadcastInternalEvent res = objectMapper.readValue(broadcastEventStr, DefaultBroadcastInternalEvent.class);
Assert.assertEquals(res.getServiceName(), "service");
Assert.assertEquals(res.getType(), "PLUGIN_INSTALL");
Assert.assertEquals(res.getJsonEvent(), eventJson);
}
}
内容来源于网络,如有侵权,请联系作者删除!