@Override
	protected Object convertFromInternal(Message<?> message, Class<?> targetClass, Object conversionHint) {
		Object result;
		try {
			if (prettyPrint) {
				result = mapper.writerWithDefaultPrettyPrinter().writeValueAsString(message.getPayload());
			}
			else {
				result = mapper.writeValueAsString(message.getPayload());
			}
		}
		catch (JsonProcessingException e) {
			logger.error(e.getMessage(), e);
			return null;
		}
		return buildConvertedMessage(result, message.getHeaders(), MimeTypeUtils.APPLICATION_JSON);
	}
A {@link org.springframework.messaging.converter.MessageConverter}
to convert a Java object to a JSON String

@author David Turanski
@author David Liu
spring-xd-dirt/src/main/java/org/springframework/xd/dirt/integration/bus/converter/PojoToJsonMessageConverter.java