Package net.logstash.logback.decorate
Class FeatureDecorator<T,F extends Enum<F>>
java.lang.Object
net.logstash.logback.decorate.FeatureDecorator<T,F>
- Type Parameters:
T- Type of object being decorated (e.g.JsonFactory)F- Feature enum type (e.g.JsonFactory.Feature)
- Direct Known Subclasses:
CborFeatureJsonGeneratorDecorator,FeatureJsonFactoryDecorator,FeatureJsonGeneratorDecorator,SmileFeatureJsonGeneratorDecorator,YamlFeatureJsonGeneratorDecorator
A generic decorator that allows enabling/disabling of Jackson features.
-
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedFeatureDecorator(Class<F> enumType, BiFunction<T, F, T> enableFunction, BiFunction<T, F, T> disableFunction) -
Method Summary
Modifier and TypeMethodDescriptionvoidaddDisable(String feature) Disables the feature with the given name.voidEnables the feature with the given name.voidDisables the given feature.voidEnables the given feature.
-
Constructor Details
-
FeatureDecorator
protected FeatureDecorator(Class<F> enumType, BiFunction<T, F, T> enableFunction, BiFunction<T, F, T> disableFunction)
-
-
Method Details
-
decorate
-
addEnable
Enables the feature with the given name. Reflectively called by logback when reading xml configuration.- Parameters:
feature- the name of the feature to enable
-
enable
Enables the given feature. Use this method for programmatic configuration.- Parameters:
feature- the feature to enable
-
addDisable
Disables the feature with the given name. Reflectively called by logback when reading xml configuration.- Parameters:
feature- the name of the feature to disable
-
disable
Disables the given feature. Use this method for programmatic configuration.- Parameters:
feature- the feature to disable
-