public class CompositeJsonFactoryDecorator extends Object implements JsonFactoryDecorator
| Constructor and Description |
|---|
CompositeJsonFactoryDecorator() |
| Modifier and Type | Method and Description |
|---|---|
void |
addDecorator(JsonFactoryDecorator decorator) |
JsonFactory |
decorate(JsonFactory factory)
Decorates the given
JsonFactory. |
MappingJsonFactory |
decorate(MappingJsonFactory factory)
Deprecated.
|
boolean |
removeDecorator(JsonFactoryDecorator decorator) |
@Deprecated public MappingJsonFactory decorate(MappingJsonFactory factory)
JsonFactoryDecoratorMappingJsonFactory.
By default, returns the given factory unchanged.decorate in interface JsonFactoryDecoratorpublic JsonFactory decorate(JsonFactory factory)
JsonFactoryDecoratorJsonFactory.
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 JsonFactoryDecorators
to any subclass of JsonFactory.decorate in interface JsonFactoryDecoratorJsonFactorypublic void addDecorator(JsonFactoryDecorator decorator)
public boolean removeDecorator(JsonFactoryDecorator decorator)
Copyright © 2019. All rights reserved.