Skip to content

Conversation

@cboehme
Copy link
Member

@cboehme cboehme commented Nov 28, 2013

The first commit extends ObjectWriter to output user-defined header, footer and separator strings. The second one fixes the output of unnecessary spaces by JsonEncoder.

These settings allow to prefix the output with a header string and to
append a footer at the end of the stream. Additionally, the separator
between objects can be now changed. Previously, this was always a
newline character.

The default settings of header, footer and separator are chosen so that
the output of ObjectWriter is the same as in the old version of the
module (i.e. a new line character is append to each object).

In addition to these new options the encoding and compression options
can now be set via Flux.

This commit offers a solution for issue metafacture#152: The output of the JSON
encoder can be turned into a JSON array by setting header to "[",
separator to ", " and footer to "]".
Starting from the second object JsonEncoder added a space character to
each serialised object it generated (as pointed out in issue metafacture#152). This
commit changes the configuration of the JSON generator used by
JsonEncoder to not output these spaces.
cboehme added a commit that referenced this pull request Dec 4, 2013
@cboehme cboehme merged commit b245c80 into metafacture:master Dec 4, 2013
@cboehme cboehme deleted the issue-152-additonal-writer-options branch December 4, 2013 17:28
blackwinter added a commit to blackwinter/metafacture-core that referenced this pull request Oct 16, 2017
Jackson's JsonGenerator doesn't apply configured root value separator to pretty-printer.

Ref.: metafacture#153 (d84456a)
cboehme pushed a commit that referenced this pull request Oct 20, 2017
Jackson's JsonGenerator doesn't apply configured root value separator to
pretty-printer.

Ref.: #153 (d84456a)
blackwinter pushed a commit that referenced this pull request Dec 13, 2024
blackwinter pushed a commit that referenced this pull request Dec 13, 2024
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.

1 participant