Class ContextProviderFactory

java.lang.Object
com.atlassian.greenhopper.web.contextprovider.ContextProviderFactory

@Component public class ContextProviderFactory extends Object
A convenient helper used to get an instance of a context provider defined in any other plugin. It's using WebFragmentHelper as underlying implementation.
  • Constructor Details

    • ContextProviderFactory

      public ContextProviderFactory()
  • Method Details

    • loadContextProviderOfViewIssuePlugin

      public com.atlassian.plugin.web.ContextProvider loadContextProviderOfViewIssuePlugin(FieldDetailsCategory fieldDetailsCategory)
      This is used for loading a context provider of View Issue plugin based on given category FieldDetailsCategory
      Parameters:
      fieldDetailsCategory -
      Returns:
    • loadContextProviderOfViewIssuePlugin

      public com.atlassian.plugin.web.ContextProvider loadContextProviderOfViewIssuePlugin(Class<? extends com.atlassian.plugin.web.ContextProvider> contextProviderClass)
      This is used for loading a context provider of View Issue plugin based on given context provider class.
      Parameters:
      contextProviderClass -
      Returns:
    • loadContextProvider

      public com.atlassian.plugin.web.ContextProvider loadContextProvider(Class<? extends com.atlassian.plugin.web.ContextProvider> contextProviderClass, String pluginKey)
      A convenient wrapper for the WebFragmentHelper#loadContextProvider method used to get an instance of a context provided defined in another plugin.
      Parameters:
      contextProviderClass - the concrete context provider class to create a new instance of it
      pluginKey - key (defined in an atlassian-plugin.xml file) Of the plugin from which the context provider is defined
      Returns:
      the context provider instance. Every time calling to this method, a new instance will be returned.

      Caution: an attempt to cast the returning value to the concrete context provider (e.g the class provided via contextProviderClass argument) may fail since a context provider can be an instance of a @CacheableContextProvider and the returning value will be a @CacheableContextProviderDecorator

      See Also:
      • WebFragmentHelper.loadContextProvider(java.lang.String, com.atlassian.plugin.Plugin)