类 Instantiator<T>

java.lang.Object
org.springframework.boot.util.Instantiator<T>
类型参数:
T - the type to instantiate

public class Instantiator<T> extends Object
Simple factory used to instantiate objects by injecting available parameters.
从以下版本开始:
2.4.0
作者:
Phillip Webb, Scott Frederick
  • 构造器详细资料

  • 方法详细资料

    • instantiate

      public List<T> instantiate(Collection<String> names)
      Instantiate the given set of class name, injecting constructor arguments as necessary.
      参数:
      names - the class names to instantiate
      返回:
      a list of instantiated instances
    • instantiate

      public List<T> instantiate(ClassLoader classLoader, Collection<String> names)
      Instantiate the given set of class name, injecting constructor arguments as necessary.
      参数:
      classLoader - the source classloader
      names - the class names to instantiate
      返回:
      a list of instantiated instances
      从以下版本开始:
      2.4.8
    • instantiate

      public T instantiate(String name)
      Instantiate the given set of class name, injecting constructor arguments as necessary.
      参数:
      name - the class name to instantiate
      返回:
      an instantiated instance
      从以下版本开始:
      3.4.0
    • instantiate

      public T instantiate(ClassLoader classLoader, String name)
      Instantiate the given set of class name, injecting constructor arguments as necessary.
      参数:
      classLoader - the source classloader
      name - the class name to instantiate
      返回:
      an instantiated instance
      从以下版本开始:
      3.4.0
    • instantiateType

      public T instantiateType(Class<?> type)
      Instantiate the given class, injecting constructor arguments as necessary.
      参数:
      type - the type to instantiate
      返回:
      an instantiated instance
      从以下版本开始:
      3.4.0
    • instantiateTypes

      public List<T> instantiateTypes(Collection<Class<?>> types)
      Instantiate the given set of classes, injecting constructor arguments as necessary.
      参数:
      types - the types to instantiate
      返回:
      a list of instantiated instances
      从以下版本开始:
      2.4.8
    • getArg

      public <A> A getArg(Class<A> type)
      Get an injectable argument instance for the given type. This method can be used when manually instantiating an object without reflection.
      类型参数:
      A - the argument type
      参数:
      type - the argument type
      返回:
      the argument to inject or null
      从以下版本开始:
      3.4.0