## 接口的使用
org.springframework.beans.factory.FactoryBean

- 使用FactoryBean的程序包
  程序包 | 说明
  --- | ---
  org.springframework.beans.factory | The core package implementing Spring's lightweight Inversion of Control (IoC) container.
  org.springframework.beans.factory.config | SPI interfaces and configuration-related convenience classes for bean factories.
  org.springframework.beans.factory.serviceloader | Support package for the Java 6 ServiceLoader facility.
  org.springframework.beans.factory.support | Classes supporting the `org.springframework.beans.factory` package.

- - ### org.springframework.beans.factory中FactoryBean的使用

    org.springframework.beans.factory中FactoryBean的子接口
    限定符和类型 | 接口和说明
    --- | ---
    `interface` | `SmartFactoryBean<T>` Extension of the `FactoryBean` interface.

  - ### org.springframework.beans.factory.config中FactoryBean的使用

    实现FactoryBean的org.springframework.beans.factory.config中的类
    限定符和类型 | 类和说明
    --- | ---
    `class` | `AbstractFactoryBean<T>` Simple template superclass for `FactoryBean` implementations that creates a singleton or a prototype object, depending on a flag.
    `class` | `FieldRetrievingFactoryBean` `FactoryBean` which retrieves a static or non-static field value.
    `class` | `ListFactoryBean` Simple factory for shared List instances.
    `class` | `MapFactoryBean` Simple factory for shared Map instances.
    `class` | `MethodInvokingFactoryBean` `FactoryBean` which returns a value which is the result of a static or instance method invocation.
    `class` | `ObjectFactoryCreatingFactoryBean` A `FactoryBean` implementation that returns a value which is an `ObjectFactory` that in turn returns a bean sourced from a `BeanFactory`.
    `class` | `PropertiesFactoryBean` Allows for making a properties file from a classpath location available as Properties instance in a bean factory.
    `class` | `PropertyPathFactoryBean` `FactoryBean` that evaluates a property path on a given target object.
    `class` | `ProviderCreatingFactoryBean` A `FactoryBean` implementation that returns a value which is a JSR-330 `Provider` that in turn returns a bean sourced from a `BeanFactory`.
    `class` | `ServiceLocatorFactoryBean` A `FactoryBean` implementation that takes an interface which must have one or more methods with the signatures `MyType xxx()` or `MyType xxx(MyIdType id)` (typically, `MyService getService()` or `MyService getService(String id)`) and creates a dynamic proxy which implements that interface, delegating to an underlying `BeanFactory`.
    `class` | `SetFactoryBean` Simple factory for shared Set instances.
    `class` | `YamlMapFactoryBean` Factory for a `Map` that reads from a YAML source, preserving the YAML-declared value types and their structure.
    `class` | `YamlPropertiesFactoryBean` Factory for `Properties` that reads from a YAML source, exposing a flat structure of String property values.

  - ### org.springframework.beans.factory.serviceloader中FactoryBean的使用

    实现FactoryBean的org.springframework.beans.factory.serviceloader中的类
    限定符和类型 | 类和说明
    --- | ---
    `class` | `AbstractServiceLoaderBasedFactoryBean` Abstract base class for FactoryBeans operating on the JDK 1.6 `ServiceLoader` facility.
    `class` | `ServiceFactoryBean` `FactoryBean` that exposes the 'primary' service for the configured service class, obtained through the JDK 1.6 `ServiceLoader` facility.
    `class` | `ServiceListFactoryBean` `FactoryBean` that exposes all services for the configured service class, represented as a List of service objects, obtained through the JDK 1.6 `ServiceLoader` facility.
    `class` | `ServiceLoaderFactoryBean` `FactoryBean` that exposes the JDK 1.6 `ServiceLoader` for the configured service class.

  - ### org.springframework.beans.factory.support中FactoryBean的使用

    返回FactoryBean的org.springframework.beans.factory.support中的方法
    限定符和类型 | 方法和说明
    --- | ---
    `protected FactoryBean<?>` | FactoryBeanRegistrySupport.`getFactoryBean(String beanName, Object beanInstance)` Get a FactoryBean for the given bean if possible.

    参数类型为FactoryBean的org.springframework.beans.factory.support中的方法
    限定符和类型 | 方法和说明
    --- | ---
    `protected Object` | FactoryBeanRegistrySupport.`getObjectFromFactoryBean(FactoryBean<?> factory, String beanName, boolean shouldPostProcess)` Obtain an object to expose from the given FactoryBean.
    `protected Class<?>` | FactoryBeanRegistrySupport.`getTypeForFactoryBean(FactoryBean<?> factoryBean)` Determine the type for the given FactoryBean.