|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.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 java.lang.String |
convertClassToName(java.lang.Class iface)
Converts the interface name into a String key |
|
static
|
getComponent(java.lang.Class<T> iface)
Gets a component by its interface. |
|
static
|
getComponent(java.lang.Class<T> iface,
java.lang.String componentKey)
Gets a component by its interface and its Id. |
|
protected abstract
|
getComponentInternal(java.lang.Class<T> iface)
Gets the requested component, to be overridden for each application |
|
protected abstract
|
getComponentInternal(java.lang.Class<T> iface,
java.lang.String componentKey)
Gets the requested component, to be overridden for each application |
|
static
|
getComponents(java.lang.Class<T> iface)
Gets a components by interface. |
|
protected abstract
|
getComponentsInternal(java.lang.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(java.lang.Class<T> iface)
iface
- The interface to find an implementation for
public static <T> T getComponent(java.lang.Class<T> iface, java.lang.String componentKey)
iface
- The interface to find an implementation forcomponentKey
- id of the component
protected abstract <T> T getComponentInternal(java.lang.Class<T> iface)
iface
- The interface to lookup
protected abstract <T> T getComponentInternal(java.lang.Class<T> iface, java.lang.String componentKey)
iface
- The interface to lookupcomponentKey
- key of the component
public static <T> java.util.Collection<T> getComponents(java.lang.Class<T> iface)
iface
- The interface to find an implementation for
protected abstract <T> java.util.Collection<T> getComponentsInternal(java.lang.Class<T> iface)
protected java.lang.String convertClassToName(java.lang.Class iface)
iface
- The interface to convert
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |