Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow to configure line endings and indentation #166

Merged
merged 2 commits into from
Nov 29, 2014

Conversation

digulla
Copy link
Contributor

@digulla digulla commented Nov 13, 2014

Allow to configure line endings and indentation used in the DefaultPrettyPrinter plus test cases.

@cowtowncoder
Copy link
Member

Sounds good, but I do worry about one thing -- removing a public class is a backwards-compatiblity-breaking change, so anyone who is using it (either directly or by sub-classing) would get their code broken. Would it be possible to just leave a deprecated type, which could extend the new class?

Added new API to mutate the indenter.
@digulla
Copy link
Contributor Author

digulla commented Nov 20, 2014

You're right, of course. I've restored the old API (I hope I didn't miss anything) plus extended the new API a bit.

I'm also thinking about a way to allow to define a custom pretty printer in ObjectMapper. What do you think?

@cowtowncoder
Copy link
Member

@digulla Custom pretty printer can already be configured via ObjectWriter. The goal is to move most if not all configuration into ObjectWriter, due to thread safety. I am not against adding a baseline setting for ObjectMapper (setDefaultPrettyPrinter()) if that seems useful.

@cowtowncoder
Copy link
Member

Ok; I can merge this, just one last piece of process: we need a filled Contributor License Agreement (CLA):

https://github.com/FasterXML/jackson/blob/master/contributor-agreement.pdf

(unless I have asked and gotten one -- I don't think I have, but just in case).

A filled copy is needed just once for all contributions, but we need it for the first merge.
So if you could print, fill, scan and email it to info at fasterxml dot com, that'd be great?

@digulla
Copy link
Contributor Author

digulla commented Nov 28, 2014

Re: ObjectWriter vs. ObjectMapper: I thought everyone was supposed to go via the ObjectMapper API and ObjectWriter was more of an internal API?

@cowtowncoder
Copy link
Member

No, not at all. Perhaps your impression is due to ObjectMapper having been there since beginning, but ObjectWriter and ObjectReader having been added later? Due to immutability and thread-safety, latter are nowadays preferably over mapper; ObjectMapper can be seen more as a factory for readers and writers.

But much of documentation does show direct usage via ObjectMapper still.

cowtowncoder added a commit that referenced this pull request Nov 29, 2014
Allow to configure line endings and indentation
@cowtowncoder cowtowncoder merged commit d6a05f3 into FasterXML:master Nov 29, 2014
@cowtowncoder
Copy link
Member

Merged, thanks again!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants