public class YamlJsonFactoryDecorator extends Object implements JsonFactoryDecorator
JsonFactoryDecorator
that will switch the output
to YAML output instead of JSON text.
See also YamlFeatureJsonGeneratorDecorator
for configuring YAMLGenerator
features.
Constructor and Description |
---|
YamlJsonFactoryDecorator() |
Modifier and Type | Method and Description |
---|---|
JsonFactory |
decorate(JsonFactory factory)
Decorates the given
JsonFactory . |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
decorate
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.