com.atlassian.jira.util
Interface ComponentLocator

All Known Implementing Classes:
JiraComponentLocator

@InjectableComponent
public interface ComponentLocator

A locator that allows components to be looked up at runtime.

Since:
v4.0

Method Summary
<T> T
getComponent(Class<T> type)
          Find a component of the passed class in JIRA.
<T> T
getComponentInstanceOfType(Class<T> type)
          Find a component of the passed class in JIRA.
<T> com.google.common.base.Supplier<T>
getComponentSupplier(Class<T> type)
          Create a Supplier for the passed component.
 

Method Detail

getComponentInstanceOfType

<T> T getComponentInstanceOfType(Class<T> type)
Find a component of the passed class in JIRA.

Type Parameters:
T - the type of the component to look for.
Parameters:
type - the class of the component to look for. Must not be null.
Returns:
a refernce to the component or null if it could not be found.

getComponent

<T> T getComponent(Class<T> type)
Find a component of the passed class in JIRA. This is a synonym for getComponentInstanceOfType(Class) but has a shorter and more meaningful name.

Type Parameters:
T - the type of the component to look for.
Parameters:
type - the class of the component to look for. Must not be null.
Returns:
a refernce to the component or null if it could not be found.

getComponentSupplier

@Nonnull
<T> com.google.common.base.Supplier<T> getComponentSupplier(Class<T> type)
Create a Supplier for the passed component.

Type Parameters:
T - the type of the component to look for.
Parameters:
type - the class of the component to look for. Must not be null.
Returns:
a Supplier for the component.
Since:
6.2.3.


Copyright © 2002-2014 Atlassian. All Rights Reserved.