接口 BeanProvider


  • public interface BeanProvider
    Used to tell the library how to instantiate a bean.
    • 字段详细资料

      • DEFAULT_PRIORITY

        static final int DEFAULT_PRIORITY
        另请参阅:
        常量字段值
    • 方法详细资料

      • getPriority

        default int getPriority()
        The priority. The higher is selected than lower.
        返回:
        the priority
      • support

        boolean support​(Class<?> type,
                        BeanUsage usage)
        Test whether the type is supported by this provider. If not sure or hard to check, just return true. If get(Class, BeanUsage, Object) return null, The library think this provider not support the type as well.
        参数:
        type - the bean type
        usage - the bean usage
        返回:
        whether the type is supported by this provider.
      • get

        <T> T get​(Class<T> type,
                  BeanUsage usage,
                  Object requester)
        create or get a instance of the type.
        类型参数:
        T - the bean type
        参数:
        type - the bean type
        usage - the bean usage
        requester - the bean request the instance.
        返回:
        the bean instance.