@Inject public ProcessConfigUtils( @Nonnull @JsonFormat ObjectMapper jsonMapper, @Nonnull @YamlFormat ObjectMapper yamlMapper, @Nonnull PlaceholderResolverJsonNodeFactory placeholderResolverJsonNodeFactory) { this.jsonMapper = jsonMapper; this.yamlMapper = yamlMapper; // configuring mapper here is dead ugly, but I do not yet understand how ObjectMapperModule works to do it properly this.jsonMapper.setNodeFactory(placeholderResolverJsonNodeFactory); this.yamlMapper.setNodeFactory(placeholderResolverJsonNodeFactory); }
@Inject public ProcessConfigUtils( @Nonnull @JsonFormat ObjectMapper jsonMapper, @Nonnull @YamlFormat ObjectMapper yamlMapper, @Nonnull PlaceholderResolverJsonNodeFactory placeholderResolverJsonNodeFactory) { this.jsonMapper = jsonMapper; this.yamlMapper = yamlMapper; // configuring mapper here is dead ugly, but I do not yet understand how ObjectMapperModule works to do it properly this.jsonMapper.setNodeFactory(placeholderResolverJsonNodeFactory); this.yamlMapper.setNodeFactory(placeholderResolverJsonNodeFactory); }
/** * Return a preconfigured {@link ObjectMapper} * * <p>The returned mapper will have the following features enabled:</p> * * <ul> * <li>{@link DeserializationFeature#USE_BIG_DECIMAL_FOR_FLOATS};</li> * <li>{@link SerializationFeature#WRITE_BIGDECIMAL_AS_PLAIN};</li> * <li>{@link SerializationFeature#INDENT_OUTPUT}.</li> * </ul> * * <p>This returns a new instance each time.</p> * * @return an {@link ObjectMapper} */ public static ObjectMapper newMapper() { return new ObjectMapper().setNodeFactory(FACTORY) .enable(DeserializationFeature.USE_BIG_DECIMAL_FOR_FLOATS) .enable(SerializationFeature.WRITE_BIGDECIMAL_AS_PLAIN) .enable(SerializationFeature.INDENT_OUTPUT); } }
/** * Return a preconfigured {@link ObjectMapper} * * <p>The returned mapper will have the following features enabled:</p> * * <ul> * <li>{@link DeserializationFeature#USE_BIG_DECIMAL_FOR_FLOATS};</li> * <li>{@link SerializationFeature#WRITE_BIGDECIMAL_AS_PLAIN};</li> * <li>{@link SerializationFeature#INDENT_OUTPUT}.</li> * </ul> * * <p>This returns a new instance each time.</p> * * @return an {@link ObjectMapper} */ public static ObjectMapper newMapper() { return new ObjectMapper().setNodeFactory(FACTORY) .enable(DeserializationFeature.USE_BIG_DECIMAL_FOR_FLOATS) .enable(SerializationFeature.WRITE_BIGDECIMAL_AS_PLAIN) .enable(SerializationFeature.INDENT_OUTPUT); } }
public void setupObjectMapper() { mapper = new ObjectMapper(); mapper.setNodeFactory(new JsonNodeFactory() { @Override public TextNode textNode(String text) {
mapper.setNodeFactory(new ScimJsonNodeFactory());
mapper.setNodeFactory(new ScimJsonNodeFactory());