类 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]
  • 构造器详细资料

    • 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

      public <T> T getObject(Class<T> clazz)
      获取Forest接口对象(Spring方式)

      适用于Forest相关接口(非请求客户端接口)和回调函数的工厂接口

      当这些类没有实例的情况下,会先实例化并缓存下来,以后再取会通过缓存获取对象

      实例化方式:通过Spring上下文获取Bean

      指定者:
      getObject 在接口中 ForestObjectFactory
      覆盖:
      getObject 在类中 DefaultObjectFactory
      类型参数:
      T - Forest对象接口类泛型
      参数:
      clazz - Forest对象接口类
      返回:
      Forest对象实例