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

public class FeatureDecorator<T,F extends Enum<F>> extends Object
A generic decorator that allows enabling/disabling of Jackson features.
  • Constructor Details

  • Method Details

    • decorate

      public T decorate(T target)
    • addEnable

      public void addEnable(String feature)
      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

      public void enable(F feature)
      Enables the given feature. Use this method for programmatic configuration.
      Parameters:
      feature - the feature to enable
    • addDisable

      public void addDisable(String feature)
      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

      public void disable(F feature)
      Disables the given feature. Use this method for programmatic configuration.
      Parameters:
      feature - the feature to disable