Class SimpleConstructorHostContainer

java.lang.Object
com.atlassian.plugin.hostcontainer.SimpleConstructorHostContainer
All Implemented Interfaces:
HostContainer

public class SimpleConstructorHostContainer extends Object implements HostContainer
Constructs module instances, matching the constructor with the largest number of arguments first. The objects to pass to the constructor are retrieved from the passed map of classes and objects. The classes are matched on an exact class match.
Since:
2.2.0
  • Constructor Details

    • SimpleConstructorHostContainer

      public SimpleConstructorHostContainer(Map<Class<?>,Object> context)
  • Method Details

    • create

      public <T> T create(Class<T> moduleClass)
      Creates a class instance, performing dependency injection using the initialised context map
      Specified by:
      create in interface HostContainer
      Parameters:
      moduleClass - The target object class
      Returns:
      The instance
      Throws:
      IllegalArgumentException - Wraps any exceptions thrown during the constructor call