Class Instantiator<T>

java.lang.Object
org.springframework.boot.util.Instantiator<T>
Type Parameters:
T - the type to instantiate

public class Instantiator<T> extends Object
Simple factory used to instantiate objects by injecting available parameters.
Since:
2.4.0
Author:
Phillip Webb, Scott Frederick
  • Constructor Details

  • Method Details

    • instantiate

      public List<T> instantiate(Collection<String> names)
      Instantiate the given set of class name, injecting constructor arguments as necessary.
      Parameters:
      names - the class names to instantiate
      Returns:
      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.
      Parameters:
      classLoader - the source classloader
      names - the class names to instantiate
      Returns:
      a list of instantiated instances
      Since:
      2.4.8
    • instantiateTypes

      public List<T> instantiateTypes(Collection<Class<?>> types)
      Instantiate the given set of classes, injecting constructor arguments as necessary.
      Parameters:
      types - the types to instantiate
      Returns:
      a list of instantiated instances
      Since:
      2.4.8