Class ContextProviderFactory
java.lang.Object
com.atlassian.greenhopper.web.contextprovider.ContextProviderFactory
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 Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptioncom.atlassian.plugin.web.ContextProvider
loadContextProvider
(Class<? extends com.atlassian.plugin.web.ContextProvider> contextProviderClass, String pluginKey) A convenient wrapper for theWebFragmentHelper#loadContextProvider
method used to get an instance of a context provided defined in another plugin.com.atlassian.plugin.web.ContextProvider
loadContextProviderOfViewIssuePlugin
(FieldDetailsCategory fieldDetailsCategory) This is used for loading a context provider of View Issue plugin based on given categoryFieldDetailsCategory
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.
-
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 categoryFieldDetailsCategory
- 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 theWebFragmentHelper#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 itpluginKey
- 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:
-