com.atlassian.jira.util
Class JiraComponentLocator

java.lang.Object
  extended by com.atlassian.jira.util.JiraComponentLocator
All Implemented Interfaces:
ComponentLocator

public class JiraComponentLocator
extends Object
implements ComponentLocator

Implementation of the ComponentLocator interface. Uses JIRAs ComponentManager.getComponentInstanceOfType(Class) method to actually do the lookup.

Since:
v4.0

Constructor Summary
JiraComponentLocator()
           
 
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.
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

JiraComponentLocator

public JiraComponentLocator()
Method Detail

getComponentInstanceOfType

public <T> T getComponentInstanceOfType(Class<T> type)
Description copied from interface: ComponentLocator
Find a component of the passed class in JIRA.

Specified by:
getComponentInstanceOfType in interface ComponentLocator
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

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

Specified by:
getComponent in interface ComponentLocator
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.

toString

public String toString()
Overrides:
toString in class Object


Copyright © 2002-2013 Atlassian. All Rights Reserved.