org.springframework.beans.factory.config

## 类 DeprecatedBeanWarner

- java.lang.Object
- - org.springframework.beans.factory.config.DeprecatedBeanWarner

- 所有已实现的接口:
    BeanFactoryPostProcessor

      public class DeprecatedBeanWarner
      extends Object
      implements BeanFactoryPostProcessor

  Bean factory post processor that logs a warning for `@Deprecated` beans.
  从以下版本开始:
    3.0.3
  作者:
    Arjen Poutsma

- - ### 字段概要

    字段
    限定符和类型 | 字段和说明
    --- | ---
    `protected Log` | `logger` Logger available to subclasses.

  - ### 构造器概要

    构造器
    构造器和说明
    `DeprecatedBeanWarner()`

  - ### 方法概要

    所有方法 实例方法 具体方法
    限定符和类型 | 方法和说明
    --- | ---
    `protected boolean` | `isLogEnabled()` Determine whether the `logger` field is enabled.
    `protected void` | `logDeprecatedBean(String beanName, Class<?> beanType, BeanDefinition beanDefinition)` Logs a warning for a bean annotated with `@Deprecated`.
    `void` | `postProcessBeanFactory(ConfigurableListableBeanFactory beanFactory)` Modify the application context's internal bean factory after its standard initialization.
    `void` | `setLoggerName(String loggerName)` Set the name of the logger to use.
    `protected void` | `writeToLog(String message)` Actually write to the underlying log.

    - ### 从类继承的方法 java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### 字段详细资料

    - #### logger

          protected transient Log logger

      Logger available to subclasses.

  - ### 构造器详细资料

    - #### DeprecatedBeanWarner

          public DeprecatedBeanWarner()

  - ### 方法详细资料

    - #### setLoggerName

          public void setLoggerName(String loggerName)

      Set the name of the logger to use. The name will be passed to the underlying logger implementation through Commons Logging, getting interpreted as log category according to the logger's configuration.

      This can be specified to not log into the category of this warner class but rather into a specific named category.

      另请参阅:
        `LogFactory.getLog(String)`, `Logger.getLogger(String)`

    - #### postProcessBeanFactory

          public void postProcessBeanFactory(ConfigurableListableBeanFactory beanFactory)
                                      throws BeansException

      从接口复制的说明: `BeanFactoryPostProcessor`
      Modify the application context's internal bean factory after its standard initialization. All bean definitions will have been loaded, but no beans will have been instantiated yet. This allows for overriding or adding properties even to eager-initializing beans.
      指定者:
        `postProcessBeanFactory` 在接口中 `BeanFactoryPostProcessor`
      参数:
        `beanFactory` - the bean factory used by the application context
      抛出:
        `BeansException` - in case of errors

    - #### logDeprecatedBean

          protected void logDeprecatedBean(String beanName,
                                           Class<?> beanType,
                                           BeanDefinition beanDefinition)

      Logs a warning for a bean annotated with `@Deprecated`.
      参数:
        `beanName` - the name of the deprecated bean
        `beanType` - the user-specified type of the deprecated bean
        `beanDefinition` - the definition of the deprecated bean

    - #### writeToLog

          protected void writeToLog(String message)

      Actually write to the underlying log.

      The default implementations logs the message at "warn" level.

      参数:
        `message` - the message to write

    - #### isLogEnabled

          protected boolean isLogEnabled()

      Determine whether the `logger` field is enabled.

      Default is `true` when the "warn" level is enabled. Subclasses can override this to change the level under which logging occurs.