类 ApplicationContextUtil

  • 所有已实现的接口:
    org.springframework.beans.factory.Aware, org.springframework.context.ApplicationContextAware

    @Component
    public class ApplicationContextUtil
    extends Object
    implements org.springframework.context.ApplicationContextAware
    • 构造器详细资料

      • ApplicationContextUtil

        public ApplicationContextUtil()
    • 方法详细资料

      • getBean

        public static Object getBean​(String name)
                              throws org.springframework.beans.BeansException
        获取bean
        参数:
        name -
        返回:
        抛出:
        org.springframework.beans.BeansException
      • getBean

        public static <T> T getBean​(Class<T> c)
                             throws org.springframework.beans.BeansException
        抛出:
        org.springframework.beans.BeansException
      • getApplicationContext

        public static org.springframework.context.ApplicationContext getApplicationContext()
      • setApplicationContext

        public void setApplicationContext​(org.springframework.context.ApplicationContext applicationContext)
                                   throws org.springframework.beans.BeansException
        指定者:
        setApplicationContext 在接口中 org.springframework.context.ApplicationContextAware
        抛出:
        org.springframework.beans.BeansException