public class EscapeNonAsciiJsonFactoryDecorator extends Object implements JsonFactoryDecorator
JsonGenerator.Feature.ESCAPE_NON_ASCII
feature on the JsonFactory
.
Prior to 5.0, JsonGenerator.Feature.ESCAPE_NON_ASCII
was enabled by default.
In 5.0, the feature is disabled by default, and can be re-enabled with this decorator.Constructor and Description |
---|
EscapeNonAsciiJsonFactoryDecorator() |
Modifier and Type | Method and Description |
---|---|
JsonFactory |
decorate(JsonFactory factory)
Decorates the given
JsonFactory . |
MappingJsonFactory |
decorate(MappingJsonFactory factory)
Deprecated.
|
@Deprecated public MappingJsonFactory decorate(MappingJsonFactory factory)
JsonFactoryDecorator
MappingJsonFactory
.
By default, returns the given factory unchanged.decorate
in interface JsonFactoryDecorator
public JsonFactory decorate(JsonFactory factory)
JsonFactoryDecorator
JsonFactory
.
By default, for backwards compatibility purposes,
this assumes the given factory is a MappingJsonFactory
,
and calls JsonFactoryDecorator.decorate(MappingJsonFactory)
so that existing
implementations that only implemented JsonFactoryDecorator.decorate(MappingJsonFactory)
continue to work.
In a future release, this will be changed to return the given factory by default,
and JsonFactoryDecorator.decorate(MappingJsonFactory)
will be removed.
It is recommended to only override JsonFactoryDecorator.decorate(JsonFactory)
.
Existing implementations should migrate to only overriding JsonFactoryDecorator.decorate(JsonFactory)
so that they will continue to work after JsonFactoryDecorator.decorate(MappingJsonFactory)
is removed.
Note that the default JsonFactory
created by logstash-logback-encoder
is a MappingJsonFactory
, but can be changed by JsonFactoryDecorator
s
to any subclass of JsonFactory
.decorate
in interface JsonFactoryDecorator
JsonFactory
Copyright © 2020. All rights reserved.