All Downloads are FREE. Search and download functionalities are using the official Maven repository.

im.aop.loggers.messageinterpolation.ToStringStrategyConfiguration Maven / Gradle / Ivy

Go to download

A handy and configurable sets of annotation-based loggers for Spring Boot that can log every execution of a method when entering or exiting normally or abnormally, without you writing a single line of code using aspect-oriented programming (AOP)

The newest version!
package im.aop.loggers.messageinterpolation;

import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean;
import org.springframework.boot.context.properties.EnableConfigurationProperties;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

/**
 * {@link Configuration} for {@link ToStringStrategy}.
 *
 * @author Andy Lian
 */
@Configuration(proxyBeanMethods = false)
@EnableConfigurationProperties({ReflectionToStringProperties.class})
class ToStringStrategyConfiguration {

  @Bean
  public ReflectionToStringStrategy reflectionToStringStrategy() {
    return new ReflectionToStringStrategy();
  }

  @Bean
  public ObjectToStringStrategy objectToStringStrategy() {
    return new ObjectToStringStrategy();
  }

  @Bean
  public OptionalToStringStrategy optionalToStringStrategy() {
    return new OptionalToStringStrategy();
  }

  @Bean
  public ArrayToStringStrategy arrayToStringStrategy() {
    return new ArrayToStringStrategy();
  }

  @Bean
  public IterableToStringStrategy iterableToStringStrategy() {
    return new IterableToStringStrategy();
  }

  @Bean
  @ConditionalOnMissingBean({ToStringStrategyFactory.class})
  public ToStringStrategyFactory toStringStrategyFactory() {
    return new DefaultToStringStrategyFactory();
  }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy