public abstract class ComponentLocator extends Object
getComponent(Class) will work the
same in any application, regardless of underlying dependency injection system used.| Constructor and Description |
|---|
ComponentLocator() |
| Modifier and Type | Method and Description |
|---|---|
protected String |
convertClassToName(Class iface)
Converts the interface name into a String key
|
static <T> T |
getComponent(Class<T> iface)
Gets a component by its interface.
|
static <T> T |
getComponent(Class<T> iface,
String componentKey)
Gets a component by its interface and its Id.
|
protected abstract <T> T |
getComponentInternal(Class<T> iface)
Gets the requested component, to be overridden for each application
|
protected abstract <T> T |
getComponentInternal(Class<T> iface,
String componentKey)
Gets the requested component, to be overridden for each application
|
static <T> Collection<T> |
getComponents(Class<T> iface)
Gets a components by interface.
|
protected abstract <T> Collection<T> |
getComponentsInternal(Class<T> iface) |
static boolean |
isInitialized() |
static void |
setComponentLocator(ComponentLocator loc)
Sets the component locator to use.
|
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 forpublic static <T> T getComponent(Class<T> iface, String componentKey)
iface - The interface to find an implementation forcomponentKey - id of the componentprotected abstract <T> T getComponentInternal(Class<T> iface)
iface - The interface to lookupprotected abstract <T> T getComponentInternal(Class<T> iface, String componentKey)
iface - The interface to lookupcomponentKey - key of the componentpublic static <T> Collection<T> getComponents(Class<T> iface)
iface - The interface to find an implementation forprotected abstract <T> Collection<T> getComponentsInternal(Class<T> iface)
Copyright © 2018 Atlassian. All rights reserved.