com.atlassian.jira.util
Class JiraComponentLocator

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

public class JiraComponentLocator
extends java.lang.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(java.lang.Class<T> type)
          Find a component of the passed class in JIRA.
<T> T
getComponentInstanceOfType(java.lang.Class<T> type)
          Find a component of the passed class in JIRA.
 java.lang.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(java.lang.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(java.lang.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 java.lang.String toString()
Overrides:
toString in class java.lang.Object


Copyright © 2002-2010 Atlassian. All Rights Reserved.