Class BeanContainer


  • public class BeanContainer
    extends java.lang.Object
    Bean container that can be used to get bean instances.
    • Constructor Summary

      Constructors 
      Constructor Description
      BeanContainer()  
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static <T> T getBean​(java.lang.Class<T> beanClass)
      根据 bean 名称获取 bean 实例
      static <T> java.util.Collection<T> getBeansOfType​(java.lang.Class<T> beanClass)
      Retrieves a collection of beans by their class type.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • BeanContainer

        public BeanContainer()
    • Method Detail

      • getBean

        public static <T> T getBean​(java.lang.Class<T> beanClass)
        根据 bean 名称获取 bean 实例
        Parameters:
        beanClass - bean 类型
        Returns:
        bean 实例
      • getBeansOfType

        public static <T> java.util.Collection<T> getBeansOfType​(java.lang.Class<T> beanClass)
        Retrieves a collection of beans by their class type.
        Type Parameters:
        T - the type of the beans
        Parameters:
        beanClass - the class type of the beans
        Returns:
        a collection of bean instances