类 SpringForestObjectFactory
java.lang.Object
com.dtflys.forest.reflection.DefaultObjectFactory
com.dtflys.forest.reflection.SpringForestObjectFactory
- 所有已实现的接口:
ForestObjectFactory,org.springframework.beans.factory.Aware,org.springframework.context.ApplicationContextAware
public class SpringForestObjectFactory
extends DefaultObjectFactory
implements org.springframework.context.ApplicationContextAware
- 从以下版本开始:
- 2021-09-18 1:00
- 作者:
- gongjun[dt_flys@hotmail.com]
-
构造器概要
构造器 -
方法概要
修饰符和类型方法说明<T> T获取Forest接口对象(Spring方式)voidsetApplicationContext(org.springframework.context.ApplicationContext applicationContext) 从类继承的方法 com.dtflys.forest.reflection.DefaultObjectFactory
getObjectFromCache, registerConstructor, registerObject
-
构造器详细资料
-
SpringForestObjectFactory
public SpringForestObjectFactory()
-
-
方法详细资料
-
setApplicationContext
public void setApplicationContext(org.springframework.context.ApplicationContext applicationContext) throws org.springframework.beans.BeansException - 指定者:
setApplicationContext在接口中org.springframework.context.ApplicationContextAware- 抛出:
org.springframework.beans.BeansException
-
getObject
获取Forest接口对象(Spring方式)适用于Forest相关接口(非请求客户端接口)和回调函数的工厂接口
当这些类没有实例的情况下,会先实例化并缓存下来,以后再取会通过缓存获取对象
实例化方式:通过Spring上下文获取Bean
- 指定者:
getObject在接口中ForestObjectFactory- 覆盖:
getObject在类中DefaultObjectFactory- 类型参数:
T- Forest对象接口类泛型- 参数:
clazz- Forest对象接口类- 返回:
- Forest对象实例
-