List of usage examples for com.fasterxml.jackson.databind ObjectMapper setSerializerFactory
public ObjectMapper setSerializerFactory(SerializerFactory f)
From source file:org.springframework.amqp.support.converter.Jackson2JsonMessageConverterTests.java
@Test public void simpleTradeOverrideMapper() { ObjectMapper mapper = new ObjectMapper(); mapper.setSerializerFactory(BeanSerializerFactory.instance); converter.setJsonObjectMapper(mapper); Message message = converter.toMessage(trade, new MessageProperties()); SimpleTrade marshalledTrade = (SimpleTrade) converter.fromMessage(message); assertEquals(trade, marshalledTrade); }
From source file:org.springframework.boot.actuate.context.properties.ConfigurationPropertiesReportEndpoint.java
/** * Ensure only bindable and non-cyclic bean properties are reported. * @param mapper the object mapper// ww w. j av a 2s . co m */ private void applySerializationModifier(ObjectMapper mapper) { SerializerFactory factory = BeanSerializerFactory.instance .withSerializerModifier(new GenericSerializerModifier()); mapper.setSerializerFactory(factory); }