类 SpringUtils

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

    @Component
    public final class SpringUtils
    extends cn.hutool.extra.spring.SpringUtil
    spring工具类
    作者:
    Lion Li
    • 构造器概要

      构造器 
      构造器 说明
      SpringUtils()  
    • 方法概要

      所有方法 静态方法 具体方法 
      修饰符和类型 方法 说明
      static boolean containsBean​(String name)
      如果BeanFactory包含一个与所给名称匹配的bean定义,则返回true
      static String[] getAliases​(String name)
      如果给定的bean名字在bean定义中有别名,则返回这些别名
      static <T> T getAopProxy​(T invoker)
      获取aop代理对象
      static Class<?> getType​(String name)  
      static boolean isSingleton​(String name)
      判断以给定名字注册的bean定义是一个singleton还是一个prototype。
      • 从类继承的方法 cn.hutool.extra.spring.SpringUtil

        getActiveProfile, getActiveProfiles, getApplicationContext, getApplicationName, getBean, getBean, getBean, getBean, getBeanFactory, getBeanNamesForType, getBeansOfType, getConfigurableBeanFactory, getProperty, postProcessBeanFactory, publishEvent, publishEvent, registerBean, setApplicationContext, unregisterBean
    • 构造器详细资料

      • SpringUtils

        public SpringUtils()
    • 方法详细资料

      • containsBean

        public static boolean containsBean​(String name)
        如果BeanFactory包含一个与所给名称匹配的bean定义,则返回true
        参数:
        name -
        返回:
        boolean
      • isSingleton

        public static boolean isSingleton​(String name)
                                   throws org.springframework.beans.factory.NoSuchBeanDefinitionException
        判断以给定名字注册的bean定义是一个singleton还是一个prototype。 如果与给定名字相应的bean定义没有被找到,将会抛出一个异常(NoSuchBeanDefinitionException)
        参数:
        name -
        返回:
        boolean
        抛出:
        org.springframework.beans.factory.NoSuchBeanDefinitionException
      • getType

        public static Class<?> getType​(String name)
                                throws org.springframework.beans.factory.NoSuchBeanDefinitionException
        参数:
        name -
        返回:
        Class 注册对象的类型
        抛出:
        org.springframework.beans.factory.NoSuchBeanDefinitionException
      • getAliases

        public static String[] getAliases​(String name)
                                   throws org.springframework.beans.factory.NoSuchBeanDefinitionException
        如果给定的bean名字在bean定义中有别名,则返回这些别名
        参数:
        name -
        抛出:
        org.springframework.beans.factory.NoSuchBeanDefinitionException
      • getAopProxy

        public static <T> T getAopProxy​(T invoker)
        获取aop代理对象
        参数:
        invoker -
        返回: