|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.atlassian.sal.api.component.ComponentLocator
public abstract class ComponentLocator
Unified interface to access components via their interface. Calling getComponent(Class) will work the
same in any application, regardless of underlying dependency injection system used.
| Constructor Summary | |
|---|---|
ComponentLocator()
|
|
| Method Summary | ||
|---|---|---|
protected String |
convertClassToName(Class iface)
Converts the interface name into a String key |
|
static
|
getComponent(Class<T> iface)
Gets a component by its interface. |
|
static
|
getComponent(Class<T> iface,
String componentKey)
Gets a component by its interface and its Id. |
|
protected abstract
|
getComponentInternal(Class<T> iface)
Gets the requested component, to be overridden for each application |
|
protected abstract
|
getComponentInternal(Class<T> iface,
String componentKey)
Gets the requested component, to be overridden for each application |
|
static
|
getComponents(Class<T> iface)
Gets a components by interface. |
|
protected abstract
|
getComponentsInternal(Class<T> iface)
|
|
static boolean |
isInitialized()
|
|
static void |
setComponentLocator(ComponentLocator loc)
Sets the component locator to use. |
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public ComponentLocator()
| Method Detail |
|---|
public static void setComponentLocator(ComponentLocator loc)
loc - The implementation to usepublic static boolean isInitialized()
public static <T> T getComponent(Class<T> iface)
iface - The interface to find an implementation for
public static <T> T getComponent(Class<T> iface,
String componentKey)
iface - The interface to find an implementation forcomponentKey - id of the component
protected abstract <T> T getComponentInternal(Class<T> iface)
iface - The interface to lookup
protected abstract <T> T getComponentInternal(Class<T> iface,
String componentKey)
iface - The interface to lookupcomponentKey - key of the component
public static <T> Collection<T> getComponents(Class<T> iface)
iface - The interface to find an implementation for
protected abstract <T> Collection<T> getComponentsInternal(Class<T> iface)
protected String convertClassToName(Class iface)
iface - The interface to convert
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||