org.springframework.aop.framework.autoproxy

## 类 AutoProxyUtils

- java.lang.Object
- - org.springframework.aop.framework.autoproxy.AutoProxyUtils

-     public abstract class AutoProxyUtils
      extends Object

  Utilities for auto-proxy aware components. Mainly for internal use within the framework.
  从以下版本开始:
    2.0.3
  作者:
    Juergen Hoeller
  另请参阅:
    `AbstractAutoProxyCreator`

- - ### 字段概要

    字段
    限定符和类型 | 字段和说明
    --- | ---
    `static String` | `ORIGINAL_TARGET_CLASS_ATTRIBUTE` Bean definition attribute that indicates the original target class of an auto-proxied bean, e.g. to be used for the introspection of annotations on the target class behind an interface-based proxy.
    `static String` | `PRESERVE_TARGET_CLASS_ATTRIBUTE` Bean definition attribute that may indicate whether a given bean is supposed to be proxied with its target class (in case of it getting proxied in the first place).

  - ### 构造器概要

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

  - ### 方法概要

    所有方法 静态方法 具体方法
    限定符和类型 | 方法和说明
    --- | ---
    `static Class<?>` | `determineTargetClass(org.springframework.beans.factory.config.ConfigurableListableBeanFactory beanFactory, String beanName)` Determine the original target class for the specified bean, if possible, otherwise falling back to a regular `getType` lookup.
    `static boolean` | `shouldProxyTargetClass(org.springframework.beans.factory.config.ConfigurableListableBeanFactory beanFactory, String beanName)` Determine whether the given bean should be proxied with its target class rather than its interfaces.

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

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

- - ### 字段详细资料

    - #### PRESERVE_TARGET_CLASS_ATTRIBUTE

          public static final String PRESERVE_TARGET_CLASS_ATTRIBUTE

      Bean definition attribute that may indicate whether a given bean is supposed to be proxied with its target class (in case of it getting proxied in the first place). The value is `Boolean.TRUE` or `Boolean.FALSE`.

      Proxy factories can set this attribute if they built a target class proxy for a specific bean, and want to enforce that bean can always be cast to its target class (even if AOP advices get applied through auto-proxying).

      另请参阅:
        `shouldProxyTargetClass(org.springframework.beans.factory.config.ConfigurableListableBeanFactory, java.lang.String)`

    - #### ORIGINAL_TARGET_CLASS_ATTRIBUTE

          public static final String ORIGINAL_TARGET_CLASS_ATTRIBUTE

      Bean definition attribute that indicates the original target class of an auto-proxied bean, e.g. to be used for the introspection of annotations on the target class behind an interface-based proxy.
      从以下版本开始:
        4.2.3
      另请参阅:
        `determineTargetClass(org.springframework.beans.factory.config.ConfigurableListableBeanFactory, java.lang.String)`

  - ### 构造器详细资料

    - #### AutoProxyUtils

          public AutoProxyUtils()

  - ### 方法详细资料

    - #### shouldProxyTargetClass

          public static boolean shouldProxyTargetClass(org.springframework.beans.factory.config.ConfigurableListableBeanFactory beanFactory,
                                                       @Nullable
                                                       String beanName)

      Determine whether the given bean should be proxied with its target class rather than its interfaces. Checks the `"preserveTargetClass" attribute` of the corresponding bean definition.
      参数:
        `beanFactory` - the containing ConfigurableListableBeanFactory
        `beanName` - the name of the bean
      返回:
        whether the given bean should be proxied with its target class

    - #### determineTargetClass

          @Nullable
          public static Class<?> determineTargetClass(org.springframework.beans.factory.config.ConfigurableListableBeanFactory beanFactory,
                                                                 @Nullable
                                                                 String beanName)

      Determine the original target class for the specified bean, if possible, otherwise falling back to a regular `getType` lookup.
      参数:
        `beanFactory` - the containing ConfigurableListableBeanFactory
        `beanName` - the name of the bean
      返回:
        the original target class as stored in the bean definition, if any
      从以下版本开始:
        4.2.3
      另请参阅:
        `BeanFactory.getType(String)`