Skip to content

Add DefaultXmlPrettyPrinter.withCustomNewLine() to configure linefeed for XML pretty-printing #560

@koalalam

Description

@koalalam

Jackson version: 2.14.1

In ObjectMapper case, we can do the following:

objectMapper.setDefaultPrettyPrinter(new DefaultPrettyPrinter().withObjectIndenter(new DefaultIndenter().withLinefeed("\n")));

However in XmlMapper. the default implementation Lf2SpacesIndenter

  1. Is protected
  2. Doesn't seem to support a custom line separator

Does it mean we need to provide our own implementation of Indenter just to have a different line separator?

Metadata

Metadata

Assignees

No one assigned

    Labels

    2.15For issues planned for 2.15

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions