public class CharacterEscapesJsonFactoryDecorator extends Object implements JsonFactoryDecorator
JsonFactoryDecorator that can be used to customize the JsonFactory.setCharacterEscapes(CharacterEscapes).
For example, you could change the escape sequence used for newline characters from '\n' to '
'| Modifier and Type | Class and Description |
|---|---|
static class |
CharacterEscapesJsonFactoryDecorator.Escape
Defines how a character will be escaped whenever that character is attempted to be written by a JsonGenerator.
|
| Constructor and Description |
|---|
CharacterEscapesJsonFactoryDecorator() |
| Modifier and Type | Method and Description |
|---|---|
void |
addEscape(CharacterEscapesJsonFactoryDecorator.Escape escape) |
JsonFactory |
decorate(JsonFactory factory)
Decorates the given
JsonFactory. |
boolean |
isIncludeStandardAsciiEscapesForJSON() |
void |
removeEscape(CharacterEscapesJsonFactoryDecorator.Escape escape) |
void |
setIncludeStandardAsciiEscapesForJSON(boolean includeStandardAsciiEscapesForJSON) |
public CharacterEscapesJsonFactoryDecorator()
public JsonFactory decorate(JsonFactory factory)
JsonFactoryDecoratorJsonFactory.
By default, returns the given factory unchanged.
Note that the default JsonFactory created by logstash-logback-encoder
is a MappingJsonFactory, but can be changed by JsonFactoryDecorators
to any subclass of JsonFactory.
decorate in interface JsonFactoryDecoratorfactory - the factory to decorateJsonFactorypublic boolean isIncludeStandardAsciiEscapesForJSON()
public void setIncludeStandardAsciiEscapesForJSON(boolean includeStandardAsciiEscapesForJSON)
public void addEscape(CharacterEscapesJsonFactoryDecorator.Escape escape)
public void removeEscape(CharacterEscapesJsonFactoryDecorator.Escape escape)
Copyright © 2013–2022. All rights reserved.