public class

PluginInjector

extends Object
java.lang.Object
   ↳ com.atlassian.jira.plugin.PluginInjector

Class Overview

A helper class for doing Dependency Injection on classes living in plugins.

Summary

Public Constructors
PluginInjector()
Public Methods
static <T> T newInstance(Class<T> clazz, Plugin plugin)
Returns a new instance of the given class with dependencies injected in a way appropriate to the plugin it comes from.
[Expand]
Inherited Methods
From class java.lang.Object

Public Constructors

public PluginInjector ()

Public Methods

public static T newInstance (Class<T> clazz, Plugin plugin)

Returns a new instance of the given class with dependencies injected in a way appropriate to the plugin it comes from.

If this class comes from an OSGi plugin, it will be injected by Spring, else it will be injected by Pico.

Parameters
clazz The class to construct.
plugin The Plugin that the class comes from.
Returns
  • a new instance of the given class with dependencies injected in a way appropriate to the plugin it comes from.