mirror of
https://github.com/AsamK/signal-cli
synced 2025-08-29 18:40:39 +00:00
Refactor ReceiveMessageHandler
Introduce PlainTextWriter to improve indentation handling.
This commit is contained in:
parent
6c33a89f82
commit
03c30519b1
6 changed files with 641 additions and 507 deletions
|
@ -6,18 +6,20 @@ import com.fasterxml.jackson.core.JsonGenerator;
|
|||
import com.fasterxml.jackson.core.JsonProcessingException;
|
||||
import com.fasterxml.jackson.databind.ObjectMapper;
|
||||
|
||||
import java.io.BufferedWriter;
|
||||
import java.io.IOException;
|
||||
import java.io.OutputStream;
|
||||
import java.io.OutputStreamWriter;
|
||||
import java.io.Writer;
|
||||
import java.nio.charset.StandardCharsets;
|
||||
|
||||
public class JsonWriter {
|
||||
|
||||
private final OutputStreamWriter writer;
|
||||
private final Writer writer;
|
||||
private final ObjectMapper objectMapper;
|
||||
|
||||
public JsonWriter(final OutputStream writer) {
|
||||
this.writer = new OutputStreamWriter(writer, StandardCharsets.UTF_8);
|
||||
this.writer = new BufferedWriter(new OutputStreamWriter(writer, StandardCharsets.UTF_8));
|
||||
|
||||
objectMapper = new ObjectMapper();
|
||||
objectMapper.setVisibility(PropertyAccessor.ALL, JsonAutoDetect.Visibility.PUBLIC_ONLY);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue